Skip to:
Content
Pages
Categories
Search
Top
Bottom

Access sidebar on topic page


  • vincenzon617
    Participant

    @vincenzon617

    Hi, how do I access the sidebar of the topics page – where is the file that I can add my code to so it shows up on the sidebar? What I would like to do is get the current number of replies to a topic and then depending on that, execute some shortcode.

    The code I have so far is:

    	
    	<?php $replycount = bbp_get_topic_reply_count( $r['topic_id'], true ); ?>
    	
    	<?php if($replycount > 0) : ?>
    		<?php echo do_shortcode('[adace-ad id="4420"]'); ?>
    	<?php else : ?>
    		<?php if($replycount > 9) : ?>
    			<?php echo do_shortcode('[adace-ad id="4420"]'); ?>
    			<?php echo do_shortcode('[adace-ad id="4420"]'); ?>
    		<?php endif; ?>
    		<?php if($replycount > 14) : ?>
    			<?php echo do_shortcode('[adace-ad id="4420"]'); ?>
    			<?php echo do_shortcode('[adace-ad id="4420"]'); ?>
    			<?php echo do_shortcode('[adace-ad id="4420"]'); ?>
    		<?php endif; ?>
    	<?php endif; ?>

    My PHP skills aren’t great so I’m not sure if this even works but I would just like to know where abouts the place this code, so it shows up on the sidebar, and so I can test it.

    Thanks!

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