• Resolved jayo

    (@jayo)


    Trying to perform an IF statement inside another IF statement… but unsure how to perform this.

    I have an ad running after four post listings on the front page, but I’m trying to call different ad tags based on homepage, category or post pages.

    Can anyone help?

    <?php if ($count == 3) : ?>
    <div class="content-ad">
    
    <?php if (is_home()) { ?>
    1st Ad Code
    
    <?php } elseif (is_category('Entertainment')) { ?>
    2nd Ad Code
    
    <?php } elseif (is_category('Lifestyle')) { ?>
    3rd Ad Code
    
    <?php } else { ?>
    4th Ad Code
    <?php } ?>
    
    </div>
    <?php endif; $count++; ?>
    • This topic was modified 7 years, 7 months ago by jayo.
    • This topic was modified 7 years, 7 months ago by Jan Dembowski.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘IF statement inside IF Statement?’ is closed to new replies.