Is This Really Simple PHP Code Correct?
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php get_template_part( 'content', get_post_format() ); ?>
<?php
$post_counter++;
if ($post_counter == 2 || $post_counter == 4) { ?>
<div style="float:right; margin-right:25px;">
adsense code is placed here
</div>
<div class="clear"></div">
<?php } ?>
<?php endwhile; ?>
<?php endif; ?>
It works fine when I have only $post_counter == 2
But when I add the ... || $post_counter == 4
It works, but the footer becomes distorted. The footer usually has no background, but when I add that part, it becomes part of the main container with the white background.
I'm confused could somebody help me?
Thank you.
Recurring Proven SEO Business Model Rent Out Your (Local) Sites and YT vids
Give you AD Funnel Super Power!
ADConnect.io - Lower CPC. Sky-Rocket Conversions!!