WordPress.org

Ready to get started?Download WordPress

Forums

WP phpBB Bridge
Useful trick: Forum avatar in post author bio (1 post)

  1. GreenLead
    Member
    Posted 1 year ago #

    Themes such as Twenty Eleven have post templates where an "About the Author" box appears at the bottom of single-page posts, especially on multi-author sites.

    Up until now, it has been difficult to get the Author Bio avatar to use the author's phpBB forum avatar. A solution was presented mbazdell, although in reality sloppy coding and typos meant that it actually didn't work.

    I've managed to fix his code, and reposted here for anyone who is interested. As always, save your work regularly and backup your files in case things go south.

    1) In wp-phpbb-bridge/inc/wpbb_functions.php, paste the contents of the following Pastebin directly after the function definition for get_forum_avatar:

    http://pastebin.com/ExEh1V3s

    2) In your child theme's copy of content-single.php, replace:

    <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyeleven_author_bio_avatar_size', 68 ) ); ?>

    with:

    <?php echo get_forum_author_avatar(get_the_author_meta('user_email'), 68); ?>

    From now on, the author bio will grab the corresponding user avatar from phpBB instead of the default Gravatar.

    Hope you guys find this useful.

    http://wordpress.org/extend/plugins/wp-phpbb-bridge/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

  • RSS feed for this topic
  • Started 1 year ago by GreenLead
  • This topic is not a support question
  • WordPress version: 3.2.1