Skip to:
Content
Pages
Categories
Search
Top
Bottom

Add Featured Image to the BBpress Index

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

  • yanseo
    Participant

    @yanseo

    Add the following code to your functions.php

    
    function 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'));
    	 }
    }
    add_action('bbp_theme_before_forum_title','forum_icons');
    

    Hope it helps ;)

    @yanseo thanks for the snippet. It works perfectly! Do you have any idea how i would change the code to add the thumbnail for sub forums instead?

    The forum index looks something like:

    PARENT FORUM
    *sub-1
    *sub-2
    *sub-3

    I attached a featured image to each sub forum. I would like those images to show where the asterisk is.

    I tried changing the action in your code to ‘bbp_theme_before_sub_forums’ but it still spits out the thumbnail/featured image for the Parent category.

    Any ideas?

    J


    WPDragon
    Participant

    @wpdragon

    Hi @yanseo, @jimmmy …this is exactly what I needed..but, im not sure why its not working for me…i dont see any change….I put this snippet into my functions.php of my site theme, correct?

    Once I put it there, then what do I do?… :-/

    Any reply would be greatly appreciated..thanks!


    WPDragon
    Participant

    @wpdragon

    I keep getting an error message when trying to upload a ‘featured image’ on the forum page..saying: “An error occurred in the upload. Please try again later.”

    I cant seem to get it to work..

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

You must be logged in to reply to this topic.