Skip to:

add a "Featured Image" to a forum

  • Hello bbpress gurus,

    First, thanks a lot for this wonderful plugin :)

    Now please forgive my French looking English…

    I’m using bbpress on a site where I’d like to show up on some template page a list of recent posts in the forum. get_posts is my friend and that’s ok.

    But I’d also like to show a nice picture of the categories in which those recent posts where posted. Well, “regular” posts on WP now can have a “Featured Image”. And I looked to add this to my forums as well.

    And I think I made it

    But not sure ^^


    I added this line in bbp-admin/bbp-forums.php :

    add_meta_box(‘postimagediv’, __(‘Featured Image’), ‘post_thumbnail_meta_box’, $this->post_type, ‘side’, ‘low’);

    in function attributes_metabox() (~ l.190)

    And it seems to be working.

    But as far as I can tell, there’s maybe 50% luck this code not doing some very bad things in the same time ^^

    PLease advice, if there is a better way to achieve this…

Viewing 10 replies - 1 through 10 (of 10 total)

  • sxalexander


    This is a bit late, but I think there’s another way to solve this.

    I think the most WordPress-y way to accomplish this is to add the following to your theme’s /functions.php:

    add_post_type_support('forum', array('thumbnail'));

    This will add the featured image metabox to all forums. See here for more details:

    Hello sxalexander,

    Yes, this is a much better way to do that.

    And it keeps the bbpress plugin unchanged, so it can safely be updated.

    Thanks !




    Can you explain further how to implement this in the functions.php – please.




    Marcin Biegun


    1. create bbpress directory in your theme directory
    2. copy there loop-single-forum.php from /wp-content/plugins/bbpress/templates/default/bbpress
    3. add wherever you wish the image to appear:
    <?php echo get_the_post_thumbnail($post_id, 'full'); ?>



    I had to add another line to get this working:

    add_theme_support( 'post-thumbnails', array( 'forum' ) );
    add_post_type_support('forum', 'thumbnail');



    thanks for the tip, it’s working perfectly…now i have a picture before the Forum Title…excatly what i need…

    Anyway i need to know how to edit it’s CSS style…

    I’m using Firebug and i was able to edit the CSS style for the topic’s thumbnails to get identical as the buddypress one…with a circle box as border…
    You should see here hxxp://

    Unfortunately when i analyze the picture your code added, i have no idea on how to find a CSS line to modify…i get only html div span body etc etc

    I tried to change the class name to ‘Thumbnail’ and i got a perfect thumbnail…. i changed it to Avatar but no result…i also declred it exactly like the Buddypress do…but nothing to do, the picture come back to the default one…

    Please sorry for my really wild and bad english :-)

    Thank you so much…



    P.s. the working code (at least for me) is the one posted by @aashepaa

    Thanks again…




    I declared as Avatar then i used this code inside theme’s function php file:

    add_post_type_support('forum', array('thumbnail'));
    function ks_forum_icons() {
    	if ( 'forum' == get_post_type() ) {
    		global $post;
    	    if ( has_post_thumbnail($post->ID) )
    	    	echo get_the_post_thumbnail($post->ID,'thumbnail',array('class' => 'alignleft forum-icon'));

    Then i changed the img.avatar style (hope to have not changed anithing else…)




    on her site/post she said we can control the icon size by css or add_image_size. can anyone give exact code for us? i don’t know what “name” we’re supposed to add size to in her above code.

    and / or could we see the css code exactly and i guess we put this code in our child theme?

    thank YOU!

Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.
Skip to toolbar