{"id":3234634,"date":"2012-12-01T16:21:21","date_gmt":"2012-12-01T16:21:21","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/categories-are-not-displayed\/"},"modified":"2016-08-20T18:19:38","modified_gmt":"2016-08-20T18:19:38","slug":"categories-are-not-displayed","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/categories-are-not-displayed\/","title":{"rendered":"Categories are not displayed."},"content":{"rendered":"<p>When using a post_type category, these are not shown.<\/p>\n<p>That is, only shows the normal post.<\/p>\n<pre><code>&lt;?php get_header(); ?&gt;\n\n&lt;div id=&quot;content&quot;&gt;\n  &lt;?php if (have_posts()) : ?&gt;\n  &lt;?php if (is_category()) { ?&gt;\n  &lt;p class=&quot;browse&quot;&gt;Est\u00e1s en: Inicio \/\/ &lt;?php single_cat_title(); ?&gt;&lt;\/p&gt;\n  &lt;?php } elseif (is_author()) { ?&gt;\n  &lt;p class=&quot;browse&quot;&gt;Archivos del autor&lt;\/p&gt;\n  &lt;?php } elseif (isset($_GET[&#039;paged&#039;]) &amp;&amp; !empty($_GET[&#039;paged&#039;])) { ?&gt;\n  &lt;p class=&quot;browse&quot;&gt;Archivos del blog&lt;\/p&gt;\n  &lt;?php } ?&gt;\n  &lt;?php while (have_posts()) : the_post(); ?&gt;\n\n&lt;div id=&quot;post&quot;&gt;\n&lt;span class=&quot;categorias&quot;&gt;\n&lt;?php\nforeach((get_the_category()) as $category) {\n    echo &#039;&lt;li class=&quot;cat-item-&#039; .$category-&gt;term_id. &#039;&quot;&gt;&lt;a href=&quot;&#039;.get_category_link($category-&gt;term_id ).&#039;&quot;&gt;&#039; . $category-&gt;cat_name . &#039;&lt;\/a&gt;&lt;\/li&gt;&#039;;\n}\n?&gt;\n&lt;\/span&gt;&lt;span class=&quot;date&quot;&gt;&lt;?php the_time(&#039;d\/m\/Y&#039;) ?&gt;&lt;\/span&gt;\n&lt;div id=&quot;title&quot;&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;Visitar &lt;?php the_title_attribute(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;\/a&gt;&lt;\/div&gt;\n&lt;div id=&quot;postcontent&quot;&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot;&gt;&lt;?php the_post_thumbnail( &#039;thumbnail&#039; ); ?&gt;&lt;\/a&gt;&lt;?php the_excerpt() ?&gt;&lt;\/div&gt;\n&lt;div class=&quot;clear&quot;&gt;&lt;\/div&gt;\n&lt;\/div&gt;\n\n  &lt;?php endwhile; ?&gt;\n  &lt;div class=&quot;clear&quot;&gt;&lt;\/div&gt;\n  &lt;div id=&quot;navigation&quot;&gt;\n\t&lt;div class=&quot;previous&quot;&gt;&lt;?php previous_posts_link( __( &#039;Anterior&#039; ) ); ?&gt;&lt;div class=&quot;clear&quot;&gt;&lt;\/div&gt;&lt;\/div&gt;\n        &lt;div class=&quot;next&quot;&gt;&lt;?php next_posts_link( __( &#039;Siguiente&#039; ) ); ?&gt;&lt;div class=&quot;clear&quot;&gt;&lt;\/div&gt;&lt;\/div&gt;\n  &lt;\/div&gt;\n  &lt;?php else : ?&gt;\n  &lt;?php endif; ?&gt;\n&lt;\/div&gt;\n\n&lt;?php get_sidebar(); ?&gt;\n&lt;?php get_footer(); ?&gt;<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-3234634","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/3234634","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/3234634\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=3234634"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}