Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forums index vs custom page shorturl


  • dustinarmstrong
    Participant

    @dustinarmstrong

    Been looking into this for a few days, and I can’t find a solution.

    By default, bbpress offers two solutions for the index of a forum page:

    • Using the default settings, and a customizable ‘forum root’ available in the settings panel
    • Using a page with a shortcode to implement the section that you want

    However, when you use the shortcode solution, there are two ‘forum root’ urls. The one that is associated with the page you want to use, and the one generated with the ‘forum root’ url.

    For example, let’s say that I created the forum using the shortcode on site.com/discuss, and I need to use custom fields to customize the appearance of that page with a header, a hero graphic, and some descriptive text. I can style it, and it looks perfect. However, the site.com/forums url is still present in the forum topic urls (site.com/forums/post, not site.com/disucss/post), and as it’s own page without the custom styling.

    While I could customize the page template for bbpress on site.com/forums, there are no methods for displaying fields defined by the client/user in the dashboard on that template, completely eliminating the purpose of using the custom page & shortcode option.

    Are there any solutions for this or am I stuck? I’ve yet to find any solutions on this.

Viewing 26 replies (of 26 total)

  • cosmiclove1978
    Participant

    @cosmiclove1978

    Hello Regnalf,

    I’m happy to report that your fix worked. I had to apply the new class to all the previous CSS code, but it did the trick!!!

    This is truly got the time to appreciate firsthand php notions such hook and filters, etc and see them at work. It was neat to be able to fine-tune the bbpress-index class vs bbpress and target one vs all parts of the site. I’m grateful.

    Pushing my luck a bit further and modeling your code above and another post I saw elsewhere, I was hoping to get a bit more granular in the way I applied my css to parts of the forum, so I tried this bit of code below to target individual topic pages (or replies?)
    but it didn’t work. If it’s not too much to ask, whenever it’s convenient for you or anyone, could you tell me if this code below somewhat does what you just provided me.

    function my_topic_class($classes) {
    	$classes[] = 'herman-topic-class';
    	return $classes;
    }
    add_filter( 'bbp_get_topic_class','my_topic_class' );

    Nowhere, when viewing the topic page or thread did I see the new class ‘herman-topic-class’ in the Inspect Element utility. With your code, the bbpress and bbpress-index appeared.
    thanks in advance for all the support.

    H

Viewing 26 replies (of 26 total)
  • You must be logged in to reply to this topic.
Skip to toolbar