Skip to:

Forums List Widget – Make dynamic Classes for the Link

  • graphiclux


    I am looking for a way to update my functions.php file to add a dynamic additional class to the bbPress Forums List Widget. Basically I would like the current code of:

    <li><a class="bbp-forum-title" href="<?php bbp_forum_permalink( $widget_query->post->ID ); ?>"><?php bbp_forum_title( $widget_query->post->ID ); ?></a></li>

    I would like to add an additional dynamic class or ID to the link. I want to do this so I can add different background images to each forum if I choose through CSS.


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

  • Robin W


    no simple way to do this in your functions file, the bbpress widgets are pretty unforgiving in allowing you to tinker with them.

    two immediate choices – fork the widgets code into your functions file and rename it – requires some php and WordPress knowledge or
    Just amend it in the bbpress file – AND make a note to need to change it on bbpress upgrades.

    The latter upsets the purists, but it’s only codes and you can’t be arrested for changing code !



    Thanks. It would be such an easy thing for bbPress to add too. I will need to fork it out. Do you know of any good tutorials to do this, I am not sure how much customization I will need to do compared to the widget code already.

    Thanks again,

    Robin W


    contact me via my website and I’ll send you the code for your functions file

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