{"id":180,"date":"2004-11-13T21:59:39","date_gmt":"2004-11-13T19:59:39","guid":{"rendered":"http:\/\/www.all-things-me.net\/blog\/archives\/2004\/11\/13\/introduction-to-categories"},"modified":"2010-08-12T02:02:55","modified_gmt":"2010-08-11T23:02:55","slug":"introduction-to-categories","status":"publish","type":"post","link":"https:\/\/www.all-things-me.net\/blog\/2004\/11\/13\/introduction-to-categories","title":{"rendered":"Introduction to categories"},"content":{"rendered":"<p>I wanted to add an introduction text to category pages. I already had a nice looking introduction text to the <i>blog<\/i> which only shows on the main page, so I thought I&#8217;d put the category descriptions in a similar box.<\/p>\n<blockquote class=\"php\"><p>\n&lt;!&#45;&#45; don&#8217;t show on a post&#8217;s page or monthly archives &#45;&#45;&gt;<br \/>\n&lt;?php if (!$single &amp;&amp; !$monthnum) { ?&gt;<br \/>\n&nbsp;&nbsp;&lt;div id=&quot;intro&quot;&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;!&#45;&#45; don&#8217;t show on category pages, either &#45;&#45;&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;?php if(!$cat) { ?&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>< Blog introduction ><\/strong><br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;?php } ?&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;!&#45;&#45; show on category pages &#45;&#45;&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;?php if ($cat) { ?&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;!&#45;&#45; single_cat_title(prefix,display) displays (with &#8216;true&#8217; parameter) the category title &#45;&#45;&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h1&gt;&lt;?php <a href=\"http:\/\/wiki.wordpress.org\/single_cat_title\">single_cat_title<\/a>(&#039;&#039;,true); ?&gt;&lt;\/h1&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;!&#45;&#45; category_description() alone doesn&#8217;t display it, that&#8217;s why you need to have the &#8216;echo&#8217; there &#45;&#45;&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;p&gt;&lt;?php echo <a href=\"http:\/\/wiki.wordpress.org\/category_description\">category_description<\/a>(); ?&gt;&lt;\/p&gt;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&lt;?php } ?&gt;<br \/>\n&nbsp;&nbsp;&lt;\/div&gt;<br \/>\n&lt;?php } ?&gt;<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>I wanted to add an introduction text to category pages. I already had a nice looking introduction text to the blog which only shows on the main page, so I thought I&#8217;d put the category descriptions in a similar box. &lt;!&#45;&#45; don&#8217;t show on a post&#8217;s page or monthly archives &#45;&#45;&gt; &lt;?php if (!$single &amp;&amp; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-180","post","type-post","status-publish","format-standard","hentry","category-wordpress"],"_links":{"self":[{"href":"https:\/\/www.all-things-me.net\/blog\/wp-json\/wp\/v2\/posts\/180","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.all-things-me.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.all-things-me.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.all-things-me.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.all-things-me.net\/blog\/wp-json\/wp\/v2\/comments?post=180"}],"version-history":[{"count":1,"href":"https:\/\/www.all-things-me.net\/blog\/wp-json\/wp\/v2\/posts\/180\/revisions"}],"predecessor-version":[{"id":1454,"href":"https:\/\/www.all-things-me.net\/blog\/wp-json\/wp\/v2\/posts\/180\/revisions\/1454"}],"wp:attachment":[{"href":"https:\/\/www.all-things-me.net\/blog\/wp-json\/wp\/v2\/media?parent=180"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.all-things-me.net\/blog\/wp-json\/wp\/v2\/categories?post=180"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.all-things-me.net\/blog\/wp-json\/wp\/v2\/tags?post=180"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}