What do I have to edit to get this done? I’m thinking of a banner ad.
Hi there,
To place banner ads between question and the first answer, you can open up the single-question.php in plugins/dw-question-answer/inc/templates/default folder, find the code below (around line 231):
</article><!-- end question -->
.. and change it into this:
</article><!-- end question -->
<div class="dwqa-banner">
Your ads goes here...
</div>
Regards,
Thank you, works!
Thought so ;).
I’m didn’t use this plugin but try to open /inc/templates/default/archive-question.php then find…
<?php while ( have_posts() ) : the_post(); ?>
<?php dwqa_load_template( 'content', 'question' ); ?>
<?php endwhile; ?>
then edit like as below.
<?php $num = 9; ?> <?php while ( have_posts() ) : the_post(); $num++ ?> <?php if ($num == 1) {?> <!--YOUR BANNER AD CODE HERE--> <?php dwqa_load_template( 'content', 'question' ); ?> <?php } else {?> <?php dwqa_load_template( 'content', 'question' ); ?> <?php endwhile; ?>
Thanks for your help!
I’ve done what you suggested but it doesn’t work, I can’t get the ad to display there.
My code would look something like this, right? Maybe I messed it up.
I think you have place the ad code in /inc/templates/default/single-question.php rather than the /inc/templates/default/archive-question.php
Please login or Register to submit your answer