Post Written by

WordPress Conditional Tags

On most situation in a wordpress theme you want to display content on the basis of page. Like display a slider only on home page or display a 468×60 banner only on single post page.

In such situations wordpress conditional tags are used to display content on the basis of the conditional tags.

So if you want to display my wordpress content slide plugin on home page and this home page is using default page template.

then you have to add following code

<?php
if(is_front_page())
{
if(function_exists('wp_content_slider')) { wp_content_slider(); }
}
?>

so after that slider will be added only on home page.

All WordPress Conditional Tags

is_home()
is_single()
is_page()
is_category()
is_author()
is_date()
is_front_page()
in_the_loop()
is_year()
is_month()
is_day()
is_time()
is_archive()
is_search()
is_paged()
is_404()

For more details check WordPress Conditional tags
Hire WordPress Expert for your website.