{"id":9982,"date":"2011-03-24T17:11:18","date_gmt":"2011-03-24T17:11:18","guid":{"rendered":"https:\/\/pt.wordpress.org\/support\/2011\/03\/24\/separacao-de-posts-por-categorias\/"},"modified":"2011-03-24T17:11:18","modified_gmt":"2011-03-24T17:11:18","slug":"separacao-de-posts-por-categorias","status":"closed","type":"topic","link":"https:\/\/pt.wordpress.org\/support\/topic\/separacao-de-posts-por-categorias\/","title":{"rendered":"Separacao de posts por categorias"},"content":{"rendered":"<p>Ola, sou novo com wordpress e estava procurando uma solucao para o seguinte problema:<\/p>\n<p>Tenho uma pagina com o loop dos posts de um portifolio com o seguinte codigo:<\/p>\n<pre><code>&lt;div class=&quot;portifolio&quot;&gt;\n&lt;?php if ( have_posts() ) : ?&gt;\n    &lt;?php $i = 0; ?&gt;\n    &lt;?php while ( have_posts() ) : the_post(); $i++; ?&gt;\n\n    &lt;div class=&quot;post_home&quot;&gt;\n        &lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; class=&quot;thumb&quot; title=&quot;&lt;?php the_title(); ?&gt;&quot;&gt;\n            &lt;?php if (has_post_thumbnail()) : ?&gt;\n                &lt;?php the_post_thumbnail(array(145,145)); ?&gt;\n            &lt;?php else : ?&gt;\n                &lt;img src=&quot;&lt;?php bloginfo(&#039;template_url&#039;); ?&gt;\/i\/noimage.jpg&quot; width=&quot;145&quot; height=&quot;145&quot; alt=&quot;&quot;\/&gt;\n            &lt;?php endif; ?&gt;\n        &lt;\/a&gt;\n    &lt;\/div&gt;\n    &lt;?php endwhile; ?&gt;\n&lt;?php endif; ?&gt;\n&lt;\/div&gt;<\/code><\/pre>\n<p>No entanto gostaria que fosse separado de acordo com as categorias de cada uma ( as quais ser\u00e3o os clientes ) e adicionado no inicio o nome da categoria seguinte.<\/p>\n<p>Dei uma procurada, porem n\u00e3o achei muita coisa parecida com a minha e o pouco q encontrei, quando fazia a separa\u00e7\u00e3o dos posts, ele pegava os posts do blog e n\u00e3o do portifolio.<\/p>\n","protected":false},"template":"","class_list":["post-9982","topic","type-topic","status-closed","hentry","topic-tag-categoria","topic-tag-categorias","topic-tag-filtar","topic-tag-filtragem","topic-tag-lista","topic-tag-portifoli","topic-tag-portifolio"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/pt.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/9982","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pt.wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/pt.wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/pt.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/9982\/revisions"}],"wp:attachment":[{"href":"https:\/\/pt.wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=9982"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}