{"id":228,"date":"2011-05-15T23:12:55","date_gmt":"2011-05-15T23:12:55","guid":{"rendered":"http:\/\/basics.css4design.com\/?p=228"},"modified":"2011-05-15T23:12:55","modified_gmt":"2011-05-15T23:12:55","slug":"conditional-tags","status":"publish","type":"post","link":"http:\/\/4design.xyz\/wordpress-basics\/conditional-tags","title":{"rendered":"Two Conditional Tags with grouping scope"},"content":{"rendered":"<p>There are many <a href=\"http:\/\/codex.wordpress.org\/Conditional_Tags\">Conditional Tags<\/a> to deal with WordPress contexts. Some of these Conditional Tags\u00a0groups several conditions. They works like \u00abCatch them all\u00bb tags. It&#8217;s very handy. It avoid multiple loops when you test some conditions.<!--more--><\/p>\n<h2>is_archive()<\/h2>\n<p>Using this tag allow you to make\u00a0\u00abone stone <del>two<\/del> <ins>four<\/ins> birds\u00bb :<\/p>\n<ul>\n<li>is_category()<\/li>\n<li>is_tag()<\/li>\n<li>is_author()<\/li>\n<li>is_date()<\/li>\n<\/ul>\n<h2>is_singular()<\/h2>\n<p>This one is very cool too (see below why) :<\/p>\n<ul>\n<li>is_single()<\/li>\n<li>is_page()<\/li>\n<li>is_attachment()<\/li>\n<\/ul>\n<p>For an exemple, Basics 0.2 (coming soon) use <em>is_singular()<\/em> when displaying Heading Section in order to not display it when the user browse a single Post, Page or attachement, because these pages display already their own general title, gathered with The Loop.<\/p>\n<p>\u00abIcing on the cake\u00bb\u00a0Basics is build with a function witch add a <em>.singular<\/em> class to the <em>body_class()<\/em> function to help you styling all that cool stuff \ud83d\ude09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are many Conditional Tags to deal with WordPress contexts. Some of these Conditional Tags\u00a0groups several conditions. They works like \u00abCatch them all\u00bb tags. It&#8217;s very handy. It avoid multiple loops when you test some conditions.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[33,36,81,82,83,84,85,86,87,88,89,125],"_links":{"self":[{"href":"http:\/\/4design.xyz\/wordpress-basics\/wp-json\/wp\/v2\/posts\/228"}],"collection":[{"href":"http:\/\/4design.xyz\/wordpress-basics\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4design.xyz\/wordpress-basics\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4design.xyz\/wordpress-basics\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4design.xyz\/wordpress-basics\/wp-json\/wp\/v2\/comments?post=228"}],"version-history":[{"count":0,"href":"http:\/\/4design.xyz\/wordpress-basics\/wp-json\/wp\/v2\/posts\/228\/revisions"}],"wp:attachment":[{"href":"http:\/\/4design.xyz\/wordpress-basics\/wp-json\/wp\/v2\/media?parent=228"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4design.xyz\/wordpress-basics\/wp-json\/wp\/v2\/categories?post=228"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4design.xyz\/wordpress-basics\/wp-json\/wp\/v2\/tags?post=228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}