Skip to:
Content
Pages
Categories
Search
Top
Bottom

I want to use “add to favorite topic button” in loop of topic list

  • @kanonkanonka

    Participant

    I use bbp_topic_favorite_link to display “add to favorite topic button”.

    But this button does not work within the loop below to display the topic list.

    <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
      <article>
        <h2><?php the_title();?></h2>
        <?php bbp_topic_favorite_link( array( 'topic_id' => ''.$post->ID.'', ) ); ?>
      </article>
    <?php endif; endwhile; ?>	

    When I click on the button, “Add to favorites” can be done, but the page will be reloaded.

    Why will it be reloaded in the loop, although it will not be reloaded on the topic page?

    How do I stop reloading?

  • You must be logged in to reply to this topic.
Skip to toolbar