Skip to:
Content
Pages
Categories
Search
Top
Bottom

Add Featured Image to the BBpress Index

Viewing 7 replies - 1 through 7 (of 7 total)
  • @yanseo

    Participant

    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 😉

    @jimmmy

    Participant

    @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

    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

    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..

    @arno8

    Participant

    Anyone found a fix for this?

    @jimmmy

    Participant

    Which part? Do you have the featured image showing on the parent? Client ended up ditching subforums, so not sure how i ended up solving this. If you can’t figure out the parent, i can try and find what i did…

    @chero123

    Participant

    write code in wp-content/themes/your_theme/functions.php

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