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
:)
Written by Elias Sierra
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Wordpress
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#