Skip to:
Content
Pages
Categories
Search
Top
Bottom

code to show replies only from one topic ?


  • sergio_ept
    Participant

    @sergio_ept

    Hello, i’m tryng to show replies from one topic in a loop but something must be wrong because is showing all replies, you can view the website http://forocolombofilocadiz.com/forum/foro-de-colombofilia-en-cadiz/, this is the code:

    	<li class="bbp-body">
    
    		<?php while ( bbp_topics() ) : bbp_the_topic(); ?>
    
    			<?php bbp_get_template_part( 'loop', 'single-topic' ); ?>
    <div class="erespuestas">
    <a href="#" onclick="document.getElementById('respuestas-<?php bbp_topic_id(); ?>').style.display='block';return false;">Mostrar respuestas</a> | <a href="#" onclick="document.getElementById('respuestas-<?php bbp_topic_id(); ?>').style.display='none';return false;">Esconder respuestas</a>
    </div>
    <div id="respuestas-<?php bbp_topic_id(); ?>" style="display:none;">
    
    		<?php if ( bbp_has_replies() ) : ?>
    
    //this is the problem because this function always is showing all replies
    			<?php bbp_get_template_part( 'loop', 'replies' );
    			 
    			 ?>
    
    		<?php endif; ?>
    <div class="erespuestas">
    <a href="#" onclick="document.getElementById('respuestas-<?php bbp_topic_id(); ?>').style.display='none';return false;">Esconder respuestas</a>
    </div>
    </div>
    <!--fin-->
    
    		<?php endwhile; ?>
    
    	</li>

    i would like to show replies from each topic and not all every loop.

    sorry for my english.

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