Weekday Tip: Wordpress Conditional Tags

Weekday Tip: Wordpress Conditional Tags

Wordpress' conditional tags are by far one of the most useful and unglorified tools for theme and plugin development. Here's a list of all the tags.

The Conditional Tags can be used in your Template files to change what content is displayed and how that content is displayed on a particular page depending on what conditions that page matches. For example, you might want to display a snippet of text above the series of posts, but only on the main page of your blog. With the is_home() Conditional Tag, that task is made easy.

  • is_home()
  • is_front_page()
  • is_admin()
  • is_single()
  • is_sticky()
  • is_comments_popup()
  • comments_open()
  • pings_open()
  • is_page()
  • is_page_template()
  • is_category()
  • is_archive()
  • is_tag()
  • has_tag()
  • is_author()
  • is_date()
  • is_year()
  • is_month()
  • is_day()
  • is_time()
  • is_search()
  • is_404()
  • is_paged()
  • is_attachment()
  • is_singular()
  • is_feed()
  • is_trackback()
  • is_preview()
  • has_excerpt()
  • in_the_loop()
  • is_active_sidebar()

For a description of each visit the Wordpress codex.

Share the Love Share the Love

Add to Reddit Add to StumbleUpon Add to Mixx Add to Delicious Add to designfloat

About the author: Fire G

Hey, I'm the founder of Fire Studios, and thus, have my hands in everything that goes on here at FS. I manage the content, moderate the comments, design everything, code everything, provides a lot of articles, host the official podcast FS-Air, and run/manage most of the other sites in the FI family. Often times I'll come to be working on so many things that I hardly accomplish much, but that's what makes me who I am.

9 Reader Comments

  •  
  • Patternhead
    May 12th

    Nice post but it could have been even better if you'd linked each tag to the right codex page.

  • Mark
    May 18th

    Next week, the alphabet :

    - A
    - B
    ...

  • Pameladuat
    May 23rd

    I really very liked this post. Can I copy it to my blog? Thank you in advance. Sincerely

  • Fire G
    May 23rd

    Sure, just put a link back to here in the article.

  • raghu
    May 28th

    Hi, thanks,
    i want to learn full php, so pleaz send the link for me, how to learn PHP in easy way,,,,

    byee, thank you.

  • KeHoeff
    May 28th

    hey this is a very interesting article!

  • Raj
    May 31st

    I want to learn full PHP very easily, o please send me links. Let me know how to learn PHP very easy way....

    bye, thanks

  • Fire G
    May 31st

    @Raj: You can learn the basics of PHP at W3Schools.

  • Adam
    June 7th

    And again! Thank you. Pesky Wordpress!

Leave a Reply