Here’s a list of conditional tags you can use in the Widget Logic plugin, theme specific hook plugins and custom functions.
I’ll be adding code snippets which are commonly used with these conditional tags to help you customize your theme using PHP code.
comments_open
has_tag
has_term
in_category
is_404
is_admin
is_archive
is_attachment
is_author
is_category
is_child_theme
is_comments_popup
is_date
is_day
is_feed
is_front_page
is_home
is_month
is_multi_author
is_multisite
is_main_site
is_page
is_page_template
is_paged
is_preview
is_rtl
is_search
is_single
is_singular
is_sticky
is_super_admin
is_tag
is_tax
is_time
is_trackback
is_year
pings_open
You’ll find some code examples using conditional tags on the WordPress Codex which you can use or modify according to your needs.
Note: PHP code is open source and may be used and modified according to the PHP license.
Was This Tutorial Helpful?