Status
Not open for further replies.

elma22

Banned
Banned
66
2013
4
0
hello guys,

the next code can hide the post/content after 3 days on wordpress site, so when i have an offer for 3 days, after 3 days it will hide it:

PHP:
<?php 
$ddate = get_the_time("Y-m-d");
$post_age = strtotime('today') - strtotime($ddate);
$post_day = $post_age / 60 / 60 / 24;
if($post_day > 2 ) { ?>
<div class="single-post">
<p><strong>Content Is Locked,coz its 3 or more than 3 days old</strong></p>
</div>
<?php }
else{ ?>
<div class="single-post">
<?php the_content(); 
}?>
</div>

but is it possible to use this code to show ads after 3 days?

maybe i replace <p><strong>Content Is Locked,coz its 3 or more than 3 days old</strong></p> with my ads code?

and i remove <?php the_content();?


so will this work for showing ads after 3 days:


PHP:
<?php 
$ddate = get_the_time("Y-m-d");
$post_age = strtotime('today') - strtotime($ddate);
$post_day = $post_age / 60 / 60 / 24;
if($post_day > 2 ) { ?>
<div class="single-post">
-------ADS CODE HERE------
</div>
<?php }
else{ ?>
<div class="single-post">
}?>
</div>
 
2 comments
<?php the_content() is for showing up the wordpress post. If you remove it then even before 3 days it won't show anything. Sure its possible that way :|
 
Status
Not open for further replies.
Back
Top