GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Looking for Plugin that lets u insert ads (https://gfy.com/showthread.php?t=1228348)

lakerslive 11-11-2016 11:41 AM

Looking for Plugin that lets u insert ads
 
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..

CaptainHowdy 11-11-2016 02:09 PM

Lil' bump for you ...

HomerSimpson 11-12-2016 06:47 AM

how about using wp shortcodes...

here's how to do it...

In posts you put these tags where you want those ads
[videoad1]
[videoad2]
[videoad3]

and in functions.php you simply add:

Code:

function videoad1_shortcode(){
        return 'ad1 html goes here';
}
function videoad2_shortcode(){
        return 'ad2 html goes here';
}
function videoad3_shortcode(){
        return 'ad3 html goes here';
}
add_shortcode('videoad1', 'videoad1_shortcode');
add_shortcode('videoad2', 'videoad2_shortcode');
add_shortcode('videoad3', 'videoad3_shortcode');

need more help... feel free to contact me... email in sig...

Brian mike 11-14-2016 07:13 AM

I was looking for this for one of my site. Will try it out :thumbsup

fris 11-17-2016 01:37 PM

Quote:

Originally Posted by lakerslive (Post 21293017)
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;?>


HomerSimpson 11-17-2016 02:53 PM

Good point fris!
Somehow I overlooked the fact that it has to be inside a list...
%3===0 is the way to go...

fris 11-20-2016 08:33 AM

Quote:

Originally Posted by HomerSimpson (Post 21309235)
Good point fris!
Somehow I overlooked the fact that it has to be inside a list...
%3===0 is the way to go...

i think wp changed the way the post count is, when doing %3 === 0, it showed after the first post.

i think it counts first as zero, and second as 1


All times are GMT -7. The time now is 07:22 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123