Defining what content shows up based on page type

Quick code to define what content shows up based on page type. I had to have different containers show up depending on page.

The Code

<?php if( is_front_page() ): ?>
<?php elseif( is_page() ): ?>
<?php elseif ( is_single() ): ?>
<?php elseif ( is_home() ): ?>
<?php endif; ?>
Isaac Adams-Hands

Full Stack Developer, Digital Marketer, and InfoSec enthusiast. He received his Bachelor’s Degree from the University of Western Sydney and his Business Diploma from Georgian College before joining various marketing positions in search portals, e-commerce, higher education, and addiction recovery services.

Follow @ twitter

Related posts

WP Child Themes

WordPress child themes are really simple to make, but I’ve noticed most tutorials are more complicated then they need to be. All you need are two files in a folder: style.css + functions.php Style.css Replace Template: twentyseventeen with the name of your parent theme (it will be the folder name): function.php If you notice the… Read More

Installing Roots Trellis / Bedrock / Sage

Not sure how I feel about Roots.io –> The tutorials seem super easy, but I noticed you can quickly run into issues. What doesn’t help is that I can’t really find any reviews / user tutorials past 2016, the Roots discourse forum appears to be a bubble (not accepting new or differing ideas), and I… Read More