WordPress Conditional Functions

Beginner
7 min read
Updated: Nov 2026
34 function guides
Function index

About This Index

This page is the WordPress Conditional Functions index. Each row links to a full guide with syntax, three examples, and FAQs.

Learn what conditional tags are and how to use them in theme files on WordPress Conditional Tags. Use this page when you need one function, such as is_front_page(), is_single(), or is_user_logged_in().

Remember.

Conditional tags return true or false. Use them in if statements, and call them after the query is set, for example in template files. is_home() is the blog posts index, not the front page. is_admin() checks the dashboard, not the user role.

How to Call a Conditional Function

Put the function inside an if statement. When it returns true, the code in the braces runs.

WordPress
<?php // header.php or single.php ?>
<?php if ( is_front_page() ) : ?>
  <h1>Welcome!</h1>
<?php elseif ( is_single() ) : ?>
  <p>You are reading a post.</p>
<?php elseif ( is_page( 'contact' ) ) : ?>
  <p>Get in touch.</p>
<?php endif; ?>

WordPress Conditional Functions Table

All function guides in this WordPress conditional series (34 tutorials). Start with is_front_page() and is_home().

Main query & page type

9 functions

Tell the front page, blog index, single views, Pages, attachments, previews, the privacy page, and search apart.

FunctionDescriptionTutorial
is_front_page()Check if the visitor is on the site front page.Read guide
is_home()Check if the visitor is on the blog posts index.Read guide
is_singular()Check if the current page is any single view: post, Page, attachment, or custom type.Read guide
is_single()Check if the current page is a single blog post (not a Page).Read guide
is_page()Check if the current page is a WordPress Page.Read guide
is_attachment()Check if the current page is a single attachment page.Read guide
is_preview()Check if a post is being viewed in preview mode.Read guide
is_privacy_policy()Check if the current page is the Privacy Policy page.Read guide
is_search()Check if the current page shows search results.Read guide

Archives & taxonomies

11 functions

Check category, tag, author, date, time, and post type archives.

FunctionDescriptionTutorial
is_archive()Check if the current page is any kind of archive.Read guide
is_category()Check if the current page is a category archive.Read guide
is_tag()Check if the current page is a tag archive.Read guide
is_tax()Check if the current page is a custom taxonomy archive.Read guide
is_author()Check if the current page is an author archive.Read guide
is_date()Check if the current page is any date-based archive.Read guide
is_year()Check if the current page is a yearly archive.Read guide
is_month()Check if the current page is a monthly archive.Read guide
is_day()Check if the current page is a daily archive.Read guide
is_time()Check if the current page is a time-based archive (hour, minute, or second).Read guide
is_post_type_archive()Check if the current page is a custom post type archive.Read guide

Feeds & misc query

5 functions

Feeds, trackbacks, sticky posts, new days in the loop, and page templates.

FunctionDescriptionTutorial
is_feed()Check if the request is for an RSS, Atom, or other feed.Read guide
is_trackback()Check if the request is for a trackback.Read guide
is_sticky()Check if a post is a sticky post.Read guide
is_new_day()Check if the current post is on a different day than the previous post.Read guide
is_page_template()Check if the current Page uses a custom page template.Read guide

Site, user & plugins

9 functions

Check the dashboard, login state, Multisite, child themes, plugins, and widget areas.

FunctionDescriptionTutorial
is_admin()Check if the request is for the WordPress admin area (wp-admin).Read guide
is_user_logged_in()Check if the visitor is logged in.Read guide
is_multisite()Check if WordPress Multisite (a network of sites) is enabled.Read guide
is_main_site()Check if a site is the main site of a multisite network.Read guide
is_super_admin()Check if a user is a Super Admin (network administrator).Read guide
is_multi_author()Check if the site has more than one author with published posts.Read guide
is_child_theme()Check if a child theme is active.Read guide
is_plugin_active()Check if a plugin is active on the current site.Read guide
is_active_sidebar()Check if a sidebar (widget area) has at least one widget.Read guide

Frequently Asked Questions

They are functions, often called conditional tags, that answer a yes or no question about the page or the site. They return true or false, so you use them in if statements.
Use them in theme template files such as header.php, single.php, and archive.php, or on hooks like wp, template_redirect, and wp_head. They need the main query to be ready.
is_front_page() is the site front page. is_home() is the blog posts index. With a static front page they are different pages. With latest posts they are the same page.
is_single() is for single blog posts (and custom post types). is_singular() is true on any single view: a post, a Page, an attachment, or a custom post type.
No. is_admin() checks if the request is for the dashboard (wp-admin). To check a role or permission, use current_user_can().
Start with is_front_page(), is_home(), is_single(), is_page(), and is_archive(). Then learn is_category(), is_tag(), is_user_logged_in(), and is_admin().

Start with is_active_sidebar()

Check if a sidebar (widget area) has at least one widget.

is_active_sidebar() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

15 people found this page helpful