Skip to:
Content
Pages
Categories
Search
Top
Bottom

Shortcode bbp-single-topic-tag not working


  • Fourmi
    Participant

    @fourmi

    I’m trying to use this shortcode and it’s not working. I saw this issue was reported several times by the past and it seemed to be resolved but it’s still not working for me.
    I think this was the original ticket: https://bbpress.trac.wordpress.org/ticket/1948

    I want to achieve the same comportment – get a list of topics classified under a specific topic tag. Is there a way I can get the shortcode to work OR could you help me code a workaround?

    Thanks in advance!

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

  • Robkk
    Moderator

    @robkk

    It works fine for me, remember to use a topic tags id instead of a name.

    [bbp-single-tag id=$tag_id] – Display a list of all topics associated with a specific tag. eg. [bbp-single-tag id=64]

    https://codex.bbpress.org/features/shortcodes/

    To find a topic tags id, you can go to Topics > Topic Tags in the WordPress backend, then edit a topic tag and look at the url. You should see something like this. You can also hover over each edit link and look at the bottom left and see the same url appear. You will see tag_ID=(number).

    yoursite.com/wp-admin/term.php?taxonomy=topic-tag&tag_ID=4&post_type=topic&…

    To make it easier to find an ID of a post, tag, user, you can also install the Reveal IDs plugins to add a column to tables that show the ID.


    Fourmi
    Participant

    @fourmi

    Sorry my message was lacking one useful info! I’m using it from a theme file’s code, using
    echo do_shortcode('[bbp-single-tag id=19]');
    (19 is a correct topic tag id)

    It’s printing the same content that’s in the page I’m looking at (ex: in a forum I see the topics of the forum instead of the topics with the tag). It’s working if I update the query before calling the shortcode:

    $wp_query = new WP_Query(array('post_type' => 'topic'));

    I thought it should be working without having to add this but now it works so I’m happy!

    Thanks for your help!

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