{"id":11239822,"date":"2019-02-23T17:25:38","date_gmt":"2019-02-23T17:25:38","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/posts-per-page-per-post-type\/"},"modified":"2019-02-23T17:25:59","modified_gmt":"2019-02-23T17:25:59","slug":"posts-per-page-per-post-type","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/posts-per-page-per-post-type\/","title":{"rendered":"Posts Per Page -&gt; Per Post Type"},"content":{"rendered":"<p>Hi all,<br \/>\nSorry if this has been covered, been googling for a while.<br \/>\nI have a query that contains 3 custom post types (&#8216;news&#8217;, &#8216;exhibitors&#8217;, &#8216;speakers&#8217;).<br \/>\nI would like to display a total of 6 posts per page and 2 custom post types each, so two news, two exhibitors and two speakers.<br \/>\nCurrently if I specify &#8216;posts_per_page&#8217; =&gt; 6&#8242; and there is only 1 news article, 1, exhibitor there will be 4 speakers shown.<br \/>\nI almost need a &#8216;posts_per_post_type&#8217; if that makes sense.<br \/>\nQuery below, many thanks in advance.<\/p>\n<pre><code>$args = array( &#039;post_type&#039; =&gt; array(&#039;news&#039;, &#039;exhibitors&#039;, &#039;speakers&#039;), &#039;posts_per_page&#039; =&gt; 6, &#039;order&#039; =&gt; &#039;DESC&#039;, &#039;orderby&#039; =&gt; &#039;type&#039;,  &#039;paged&#039; =&gt; $paged, &#039;tax_query&#039; =&gt; array(\n                        array(\n                            &#039;taxonomy&#039; =&gt; &#039;foebar&#039;,\n                            &#039;field&#039; =&gt; &#039;slug&#039;,\n                            &#039;terms&#039; =&gt; array( $post_slug ) \n                        )\n                    ));<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-11239822","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/11239822","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":1,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/11239822\/revisions"}],"predecessor-version":[{"id":11239826,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/11239822\/revisions\/11239826"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=11239822"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}