Conditional tags (all) (tag)

cat_is_ancestor_of()

Checks if the specified category is a child of another specified category (all nesting levels are checked). Conditional tag.

category_exists()

Checks whether a category exists.

comments_open()

Whether the current post is open for comments.

email_exists()

Checks whether the given email exists.

has_block()

Determine whether a $post or a string contains a specific block type.

has_category()

Checks whether the current or specified post has at least one of the specified categories.

has_custom_header()

Check whether a custom header is set or not.

has_excerpt()

Whether the post has a custom excerpt.

has_nav_menu()

Determines whether a registered nav menu location has a menu assigned to it.

has_post_thumbnail()

Check if post has an image attached.

has_shortcode()

Whether the passed content contains the specified shortcode

has_tag()

Checks if the current post has any of the given tags. A conditional tag.

has_term()

Check if the current post has any of given terms.

have_comments()

Whether there are comments to loop over.

have_posts()

Checks if global $wp_query has posts to process. Conditional tag.

in_category()

Check if the current post is within any of the given categories.

in_the_loop()

Determines whether the caller is in The Loop (i.e. whether the loop is currently active). A conditional tag that is used to execute code only inside The Loop.

is_404()

Checks whether the 404 error page is displayed (HTTP 404: page not found). Conditional tag.

is_active_sidebar()

Whether a sidebar is in use.

is_admin()

Whether the current request is for an administrative interface page.

is_admin_bar_showing()

Determine whether the admin bar should be showing.

is_archive()

Conditional tag. Return true when any of the archive pages are shown (Year, Category, Author, Post Type archive...).

is_attachment()

Is the query for an existing attachment page?

is_author()

Is the query for an existing author archive page?

is_blog_admin()

Whether the current request is for a site's admininstrative interface.

is_blog_installed()

Test whether WordPress is already installed.

is_category()

Conditional tag. Checks whether the category page is displayed or not.

is_child_theme()

Whether a child theme is in use.

is_comment_feed()

Is the query for a comments feed?

is_customize_preview()

Checks whether the site is being previewed in the WordPress Customizer (the visual theme settings page). Conditional tag.

is_date()

Determines whether the date archive page is displayed. Conditional tag.

is_day()

Determines whether a day archive page is shown (example.com/2009/08/05) — page with posts for a specific day. A conditional tag.

is_dynamic_sidebar()

Whether the dynamic sidebar is enabled and used by theme.

is_email()

Verifies that an email is valid.

is_embed()

Is the query for an embedded post?

is_feed()

Is the query for a feed?

is_front_page()

Checks whether the main (home) page of the site is displayed. Conditional tag.

is_header_video_active()

Checks whether the custom header video is eligible to show on the current page.

is_home()

The conditional tag that checks if the page with the last posts is displayed, usually it is the main page of the site or the blog homepage.

is_local_attachment()

Check if the attachment URI is local one and is really an attachment.

is_login()

Determines whether the current request is for the login screen.

is_main_query()

Is the query the main query?

is_month()

Determines whether a monthly archive page is shown (example.com/2009/08) — page with posts for a specific month. A conditional tag.

is_multi_author()

Does this site have more than one author

is_multisite()

If Multisite is enabled.

is_nav_menu()

Check if the given ID is a navigation menu.

is_network_admin()

Whether the current request is for the network administrative interface.

is_new_day()

Whether the publish date of the current post in the loop is different from the publish date of the previous post in the loop.

is_page()

Checks whether a "static page" is displaying. You can specify an ID, name, or page title to check a specific page. Conditional tag.

is_page_template()

Whether currently in a page template.

is_paged()

Checks whether the pagination page is displayed (page type /page/2, /page/3). Conditional tag.

is_plugin_active()

Determines whether a plugin is active. Works in the dashboard only. Conditional tag.

is_post_type_archive()

Checks if current user is on the archive page of custom post type.

is_post_type_hierarchical()

Checks if the post type is hierarchical.

is_preview()

Is the query for a post or page preview?

is_robots()

Checks if this is a request to robots.txt file. A conditional tag.

is_search()

Works when the search results page is displayed. Conditional tag.

is_single()

Checks whether a post page (of any post type) is displayed. Posts with attachment and page post types will not be checked. Conditional tag.

is_singular()

Checks whether the post page is viewed (post, page, attachment, any post type). Conditional Tag.

is_ssl()

Checks whether secure HTTPS (SSL) connection is used. A conditional tag.

is_sticky()

Checks if the current post is attached to the top of the home page posts query. Conditional tag.

is_tag()

Is the query for an existing tag archive page?

is_tax()

Works on the custom taxonomy archive page. Conditional tag.

is_taxonomy_hierarchical()

Whether the taxonomy object is hierarchical.

is_textdomain_loaded()

Whether there are translations for the text domain.

is_time()

Determines whether the query is for a time-based archive page (page of posts for the specified time). A conditional tag.

is_trackback()

Is the query for a trackback endpoint call?

is_user_admin()

Whether the current request is for a user admin screen.

is_user_logged_in()

Checks if the current visitor is a logged in user.

is_year()

Determines whether a year archive page is shown (example.com/2009) — page with posts for a specific year. A conditional tag.

pings_open()

Whether the current post is open for pings.

post_exists()

Determine if a post with the specified title (post_title) exists. In addition, for the check, you can pass post_content and post_date.

post_password_required()

Whether post requires password and correct password has been provided.

shortcode_exists()

Whether a registered shortcode exists named $tag

tag_exists()

Checks whether a post tag with a given name exists.

taxonomy_exists()

Checks that the taxonomy name exists.

term_exists()

Check if a given taxonomy element exists. Returns either term ID or a term data if the element (term) exists.

term_is_ancestor_of()

Check if a term is an ancestor of another term.

wp_attachment_is()

Verifies an attachment is of a given type.

wp_doing_ajax()

Determines whether the current request is a WordPress Ajax request.

wp_doing_cron()

Determines whether the current request is a WordPress cron request.

wp_is_mobile()

Test if the current browser runs on a mobile device (smart phone, tablet, etc.)

wp_is_post_autosave()

Determines if the specified post is an autosave.

wp_is_post_revision()

Determines if the specified post is a revision.

wp_is_using_https()

Checks whether the website is using HTTPS.

wp_script_is()

Check whether a script has been added to the queue.