• Skip to primary navigation
  • Skip to main content
  • Skip to footer
  • Home
  • About
  • My Blogs
    • Photoblog
    • Knots
    • WP.com tips
kristarella.com

kristarella.com

Happiness Engineer at Automattic, lover of knitting, crochet, sci-fi and more

  • Presentations
  • Plugins
    • Exifography
  • Contact
You are here: Home / WordPress / Plugins / bbPress Forum Icons

bbPress Forum Icons

22 April 2013 by kristarella

It surprised me how long it took me to find anything about adding icons to bbPress forums! It wasn’t until it occurred to me that a useful way to implement them would be to use WordPress featured images and searched for forum featured images that I made some progress.

In the end it is really quite simple!
First you need to enable featured images on the forum post type, then you need to put that image in the right place (I prefer to use a hook action for this when I can).

The code

Just place this code in your theme’s functions.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'));
	 }
}
add_action('bbp_theme_before_forum_title','ks_forum_icons');

The code above does those two things: enables featured images on forums and then hooks the image before the forum title on the bbPress archive page (the one with all the forums listed at once).

Icons on single forum pages

If you want to show the image on single forum pages too the method might vary depending on your theme, since the main forum title on those pages is generated using the regular WordPress the_title() function.
If you’re using a theme with hooks, like Thesis or Genesis (and most ‘frameworks’, I think), you can use the relevant “before post title” hook to add the same function as above to the relevant hook. E.g., in Genesis you can use add_action('genesis_before_post_title','ks_forum_icons');

There you have it! Forum icons in bbPress.

forum list with icons

Share this:

  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on X (Opens in new window) X
  • Click to share on Pocket (Opens in new window) Pocket

Like this:

Like Loading...

Related

Filed Under: Plugins, Tutorials, WordPress Tagged With: PHP

Reader Interactions

Comments

  1. Dawn says

    23 June 2013 at 16:59

    Thanks for the guide, Krista. That’s what I’ve been wanting to do. May I ask if it’s possible to specify the size of the thumbnail?

    Dawn

  2. kristarella says

    24 June 2013 at 11:04

    Dawn, you can either use CSS or you can use add_image_size to add a custom size for your featured images and use that instead of ‘thumbnail’.

  3. Dawn says

    24 June 2013 at 17:23

    Thanks again. What I did was to change the thumbnail size in the media settings but I’ll looked into your option. Hopefully I’ll get it right.

    Thanks!
    xoxo

A triptych of baubles. These are very satisfying t A triptych of baubles. These are very satisfying to paint ❤️💚💙

#watercolor #watercolour #christmas
I have really enjoyed this Christmassy painting! S I have really enjoyed this Christmassy painting! So glad my friend asked me to make some cards for our church helpers, because it set me on a roll!
#watercolor #watercolour #christmas #christmascards #watercolorcards
Had a great Saturday at the GKR Karate State Title Had a great Saturday at the GKR Karate State Titles! I was a sub for @jamesxuereb.me in the Blue Flame Dragons thanks to his sprained ankle; we won first round and came fourth overall!
I did a bunch of judging and officiating, which was really good.
I didn’t place in my individual events, but had a very fun final round of kumite (sparring).

#gkrkarate #karate
More stamping tonight. Even better than last night More stamping tonight. Even better than last night’s!
Did some stamping this evening. Love it! I wish I’d done some pages in other ink colours before I dismantled the stamps 😂
Had an appointment in the city, so I got to visit Had an appointment in the city, so I got to visit the @legocertifiedstores_anz Wicked display!
#wicked #lego #afol #sydney
A little book I made from Bunnings paint sample ca A little book I made from Bunnings paint sample cards. It’s going to be for mini paintings and collages. Sometimes it’s nice to start with a colour rather than a blank white page!
A little while ago I did some swatching of Daniel A little while ago I did some swatching of Daniel Smith and Schminke Horodam watercolours. So soothing! I love some of the granulating colours!
#watercolours
Follow on Instagram

Footer

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Top Posts & Pages

  • Home
    Home
  • Sistaco Nail Powder Review
    Sistaco Nail Powder Review
  • Exifography
    Exifography
  • Contact Me
    Contact Me
  • Wooden yarn swift
    Wooden yarn swift
  • Clickable tags for WordPress
    Clickable tags for WordPress

Follow Me On…

  • Instagram
  • X
  • GitHub
  • LinkedIn
  • YouTube

Categories

Copyright © 2025 · Kristen Symonds · kristarella.com

%d