WordPress at a glance
Home Functions From tag: Conditional tags (all)

Conditional tags (all) (tag)

cat_is_ancestor_of()

Check if a category is an ancestor of another category.

comments_open()

Whether the current post is open for comments.

email_exists()

Checks whether the given email exists.

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()

Check if the current post has any of given tags.

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 the current WP query has results for output, i.e. if there are posts available for output on the current page. Conditional tag.

in_category()

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

in_the_loop()

Whether the caller is in the Loop.

is_404()

Is the query a 404 (returns no results)?

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()

Is the query for an existing date archive?

is_day()

Is the query for an existing day archive?

is_dynamic_sidebar()

Whether the dynamic sidebar is enabled and used by theme.

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_main_query()

Is the query the main query?

is_month()

Is the query for an existing month archive?

is_multi_author()

Does this site have more than one author

is_multisite()

If Multisite is enabled.

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()

Check whether a plugin is active.

is_post_type_archive()

Is the query for an existing post type archive page?

is_post_type_hierarchical()

Whether the post type is hierarchical.

is_preview()

Is the query for a post or page preview?

is_robots()

Is the query for the robots file?

is_search()

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

is_single()

Checks whether the post page of any post type except attachment and page is displayed. Conditional tag.

is_singular()

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

is_ssl()

Determines if SSL is used.

is_sticky()

Check if post is sticky.

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()

Is the query for a specific time?

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()

Is the query for an existing year archive?

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

taxonomy_exists()

Checks that the taxonomy name exists.

term_exists()

Check if 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_attachment_is_image()

Checks if the attachment is an image.

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_script_is()

Check whether a script has been added to the queue.