Last Updated: February 25, 2016
·
686
· elfleat

When you want to display something just on some section of your WordPress...

Wordpress have several and useful conditionals depending of the section that you want to show up.

The following example will show up a paragraph if the user visits any "Page".

<?php if(is_page()) { ?> 
<p>I am a page</p>
<?php } ?>

You can also refer to a specific page by the ID or slug:

<?php if(is_page('17') || is_page('Hello World') { ?> 
<p>I am a page 17: "Hello World"</p>
<?php } ?>

This is a very useful feature whether you use it with istag, iscategory, istaxonomy, ispost, ispage, ishome or is_frontpage().

Priceless resource for Wordpress Custom Developments

:)