Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #4935

    How to I get the author info to show on blog posts both on the blog page and when posts are drawn to the frontpage via Template Builder? I assumed this would generate automatically but it apparently does not.

    Likewise, is this also possible for the Brightbox Latest News widget?

    (We have multiple authors)

    #48201

    Here is how I do it.

    – First get the plugin called User photo at http://wordpress.org/extend/plugins/user-photo/

    – second, edit the single.php file and find the line that says:

    //show related posts if there are any
    get_template_part( 'includes/related-posts');

    below it after you have enabled the plug in and added a photo in the USERS admin section for that author add this code

    $description = get_the_author_description();
    if($description != '')
    {
    echo $description;
    }
    else
    {
    _e('The author didnt add any Information to his profile yet');
    }
    ?>
    <div class="gravatar">
    <?php
    $author_email = get_the_author_email();
    userphoto_the_author_thumbnail();
    the_author_posts_link();
    ?>
    </div>
    <?php

    - then go into the css and add your css for the class gravatar depending on your look

    a photo will show on the left with the name of the author below then on the right of the photo the Bio in the USER bio field will be shown

    hope this helps…maybe Dude has a leaner solution?

    #48202

    Thanks, Monsoon – I will try that.

    However, the gravatar is not essential. Is there a easy way to add a “posted by: __________” ?

    #48203

    Gravatar is just the name of the class I was using in Newscast, now since I use the Author plugin I kept the class that same name as it was used for both comments and authors.

    What is important is to show the author’s picture instead of just a name imo

    For multiple authors you can use the co-author plug in http://wordpress.org/extend/plugins/co-authors/ and use this code

    I prefer co-authors instead of the latest ajax version. This code will iterate through all the authors of the post and display them one after the other

    <div class="author-info">
    <h3>
    <?php _e('About the author(s)'); ?>
    </h3>
    <?php
    $description = get_the_author_description();
    if($description != '')
    {
    echo $description;
    }
    else
    {
    _e('The author didnt add any Information to his profile yet');
    }

    ?>
    <?php
    $i = new CoAuthorsIterator();
    print $i->count() == 1 ? 'Author: ' : 'Authors: ';
    $i->iterate();
    the_author(); echo"<br/><br/><br/>";
    while($i->iterate()){
    print $i->is_last() ? ' ' : ', ';
    ?>
    </div><div class="gravatar">
    <?php
    $author_email = get_the_author_email();
    userphoto_the_author_thumbnail();
    the_author_posts_link();
    ?>
    </div> <div class="author-info"><?php
    $description = get_the_author_description();echo $description; echo "<br>";
    }
    ?>
    </div>

    This will basically enable to have:

    Photo: bio of author 1

    Photo: bio of author 2

    this should be enough for you to play around with the code and layout and change it to your needs

    #48204

    Thank you, Monsoon.

    But – am I wrong in thinking this should be a relatively easy fix? The theme outputs “Categories” and “Tags” for posts. Why not also “Author”? The Velvet & Newscast Themes both do this.

    I will try the above, though I know almost nothing about css and php (hence buying a ready-made theme like Brightbox).

    #48205

    Hi,

    Thanks Monsoon for helping.

    Also, I believe you can just add this to your single.php for showing the author in posts. To show it on your homepage you can use the same but put it in your index.php file before/after the date function (wherever you want in the post loops, but this is a safe bet to start off with).

    #48206

    That did it. Thank you both very much!

    btw – I found that it needed to actually go in the loop-index.php file instead of index-php file.

    #48207

    Glad I could help you =]

Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘show author info in Brightbox?’ is closed to new replies.