Skip to:

How to filter posts by Forum AND Tags?

  • Hi- I am looking for a way to filter posts by both category AND tags.

    So Lets say I have 8 different forums and 8 tags. I am looking to filter the displayed posts so that users are only seeing the posts that are in the same specific forum AND with the same specific tag.

    I don’t think there is a specific plugin to do this. Infact the only thing I can think of to do is to edit the BBPress core files. Perhaps by combining forum.php and tags.php. And maybe even modifying the function bb_repermalink()

    Has anyone wanted to do this and succeeded? Any advice?

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

  • _ck_


    There’s no need to edit the core for that.

    It’s just a matter of a custom query.

    Do you want tags to work like that all the time?


    Yeah I am entertaining the option of a custom query right now but am unsure where exactly I might place it.

    So far I am in the middle of making a new core page ‘disp.php’ that I will try to customize in that respect.

    I don’t mind if the tags will work like that all the time, but if not, then I can always direct to the tags.php which will draw from the tag-single.php.



    The key is to edit the topic template so tags are shown as the ?tag=example&forum=123 (where 123 is the actual forum number)

    Then you have to make a plugin that hooks

    $topics = get_tagged_topics($tag->tag_id, $page);
    do_action( 'bb_tag-single.php', $tag->tag_id );


    where the function tag_forum_filter would manipulate (or regenerate) $topics based on whatever forum number $_GET is set to.

    Maybe I am missing something because I don’t totally understand the benefit of changing the topic template, assuming you mean topic.php.

    What I would really like to do is auto-filter all the displayed posts so that the only posts you could see at any time are the posts of a specific forum, which can be changed by an outside wrapper.

    This forum is going to have to heavy rely on this categorization, so really I would like to make some sort of a hook that will filter on forum if the user is on tags.php or index.php.

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