View Single Post
Old 11-17-2016, 01:37 PM  
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,363
Quote:
Originally Posted by lakerslive View Post
Between Posts. I am using a wordpress tube site

ex

Video 1
Video 2
Video 3
--ad--
video 4
video 5

tnx. I;'ve google around, nothin..
you can add to the theme code to load after every 3rd post, you bascially check the post count in the loop.

just add it before the end of the loop, or wherever you want it to show up in the markup of the theme code.

something like this.

Code:
if ( ( $wp_query->current_post + 1 ) % 3 === 0 ) {
    echo 'after every 3rd post'; // add the html ad code here
}
or

Code:
<?php if ( ( $wp_query->current_post + 1 ) % 3 === 0 ) :?>

<a href="https://gfy.com"><img src="ad.jpg"></a>

<?php endif;?>
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote