Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #407

    I liked the author information that the default theme Twentyten added below a post with avatar and text (if the author edited that entry).

    I added the appropriate code at line 55 by copying it from the single.php of the default theme.

    Code:
    <?php if ( get_the_author_meta( ‘description’ ) ) : // If a user has filled out their description, show a bio on their entries ?>
    <div id=”entry-author-info”>
    <div id=”author-avatar”>
    <?php echo get_avatar( get_the_author_meta( ‘user_email’ ), apply_filters( ‘twentyten_author_bio_avatar_size’, 60 ) ); ?>
    </div><!– #author-avatar –>
    <div id=”author-description”>
    <h2><?php printf( esc_attr__( ‘About %s’, ‘twentyten’ ), get_the_author() ); ?></h2>
    <?php the_author_meta( ‘description’ ); ?>
    <div id=”author-link”>
    “>
    <?php printf( __( ‘View all posts by %s <span class=”meta-nav”>→</span>’, ‘twentyten’ ), get_the_author() ); ?>

    </div><!– #author-link –>
    </div><!– #author-description –>
    </div><!– #entry-author-info –>
    <?php endif; ?>

    Although it works it doesn’t look really good as the classes are missing :-)

    Example: http://www.injelea-blog.de/2010/07/30/klaviator-lars-reichow-in-schwabenheim/

    Would there be a quite simple solution for that or should I try to find the appropriate CSS classes so it looks nicer?

    #31237

    It looks ok to me, but could be improved.

    You’ve already got the ID’s: #author-link / #author-description / #entry-author-info so you can play around with the styling if you want.

    Use this as a start point:

    #author-link { }
    #author-description { }
    #entry-author-info { }

    and add the styles to the ID you want to show it in.

    #31238

    This seems like the right place to ask my question; I’m using the Twicet 5 theme, which doesn’t display the author in the post, while it does display date, comments, and category. How would I go about adding “written by (author)” with the rest of the info? Thanks.

    #31239

    You’d need to add data for the author to the end of single.php (within the loop).

    Author avatar:

    <?php get_avatar( get_the_author_meta( 'user_email' ); ?>

    Author description (set in profile page):

    <?php the_author_meta( 'description' ); ?>

    Look through the code above (for Twenty Ten’s theme) to get an idea of how it’s put together.

    #31240

    Thanks!

    I changed it to my nees so author information appears as I like it to :-)

    #31241

    I thought posting complete code would help others to include. style1.css:

    Code:
    /* Author information, see single.php */
    #entry-author-info {
    border: 1px solid silver;
    background:none repeat scroll 0 0 #E9ECF0;
    padding: 8px;
    }

    #author-avatar {
    float: left;
    margin-right: 8px;
    }

    #author-link {
    text-align:right;
    }

    #author-description {
    }

    single.php:

    Code:
    <?php if ( get_the_author_meta( ‘description’ ) ) : // If a user has filled out their description, show a bio on their entries ?>
    <div id=”entry-author-info”>
    <h3><?php printf( esc_attr__( ‘Der Autor: %s’, ‘avisio’ ), get_the_author() ); ?></h3>
    <div id=”author-avatar”>
    <?php echo get_avatar( get_the_author_meta( ‘user_email’ ), apply_filters( ‘twentyten_author_bio_avatar_size’, 80 ) ); ?>
    </div><!– #author-avatar –>
    <div id=”author-description”>
    <?php the_author_meta( ‘description’ ); ?>
    </div><!– #author-description –>
    </div><!– #entry-author-info –>
    <?php endif; ?>

    #31242

    Hey!

    Thanks for sharing this!

    Regards,

    James

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

The topic ‘Author information below post?’ is closed to new replies.