Skip to:
Content
Pages
Categories
Search
Top
Bottom

display labels based on topic status?


  • Robkk
    Moderator

    @robkk

    using most of the code structure that robin gave me from

    Display Topic Starter label around topic authors avatar in topic replies

    how do i do the same for topic status like sticky, supersticky , closed

    all i probably need to change from the code from the link is

    if (bbp_get_reply_author_id() == bbp_get_topic_author_id() ) {

    to something like

    if topic status = sticky

    i just dont know how to write that line correctly with the right code

    Any help?

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

  • Robkk
    Moderator

    @robkk

    solved my own problem

    found this

    Add “Resolved” to Closed Topics in bbPress

    instead of using function.php

    i threw this into loop-single-topic ,
    the way i have my topics arranged it shows below the title

    for closed label

    <?php
       $topic_id = bbp_get_topic_id();
       if ( get_post_type( $topic_id ) == bbp_get_topic_post_type() && bbp_is_topic_closed( $topic_id ) )
          echo '<span class="closed">[CLOSED]</span>';
    ?>

    for sticky label

    <?php
       $topic_id = bbp_get_topic_id();
       if ( get_post_type( $topic_id ) == bbp_get_topic_post_type() && bbp_is_topic_sticky( $topic_id ) )
          echo '<span class="sticky">[STICKY]</span>';
    ?>

    Robin W
    Moderator

    @robin-w

    great – glad you’re fixed !

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