Skip to:

How can I edit the size and style of each forum separately?

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

  • Robin W


    each forum will show a forum ID eg

    <div id=”post-2921″ class=”post-2921 forum type-forum status-publish hentry”>

    So yes you can, but unless you’re familiar with things like firebug and CSS, then you’ll need experienced help.



    I am familiar with firebug and css, not a pro, but def familiar! How can I do this? Please

    Robin W


    ok, so 3 stages

    1. create the style.css entries – say you have a forum called ‘fred’ you might want to create a ‘fred’ style and have content for this eg

    .fred #fixed-background { background: url(‘;); }

    2. look up the forum’s ID

    go to dashboard>forums>all forums and hover over the ‘edit’

    at the bottom of the screen you’ll see

    in this case 2921 is the forum ID

    3. add the style to the body class for that forum

    Add this into your functions file

    function rew_add_class ($classes, $bbp_classes, $wp_classes, $custom_classes ) {
    	//the above line pulls in the pre-existing values so we don't lose them - ie run this function using this existing $variables if they exist
    	//then we check is this is a forum using a bbpress function
    	if ( bbp_is_single_forum() ) {
    	$bbp_forum_id = bbp_get_forum_id();
    	if ($bbp_forum_id == 2922) $custom_classes[] = 'fred' ;
    	if ($bbp_forum_id == 2923) $custom_classes[] = 'george' ;
    	//then we check is this is a topic using a bbpress function
    	if ( bbp_is_single_topic() ) {
    	//and if so look up the forum id of that topic
    	$bbp_forum_id = bbp_get_topic_forum_id();
    	//now you will need to add lines for each forum you have and say which class class you want to use, these are just example lines.  Add one for each forum
    	//the number is the 'page_id' (actually it's the post id !)
    	if ($bbp_forum_id == 2922) $custom_classes[] = 'fred' ;
    	if ($bbp_forum_id == 2923) $custom_classes[] = 'george' ;
    	//then this gets merges into the existing wordpress and bbpress classes
    	$classes = array_merge (  (array) $classes, (array) $custom_classes ) ;
    	Return apply_filters( 'rew_body_class', $classes, $bbp_classes, $wp_classes, $custom_classes ) ;
    add_filter ('bbp_body_class' , 'rew_add_class') ; 

    Robin W


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