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:
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:
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>