{"id":1301,"date":"2014-03-26T15:59:41","date_gmt":"2014-03-26T06:59:41","guid":{"rendered":"http:\/\/www.santoshkori.com\/blog\/?p=1301"},"modified":"2014-03-26T15:59:41","modified_gmt":"2014-03-26T06:59:41","slug":"how-separate-first-post-from-other-in-wordpress-loop","status":"publish","type":"post","link":"https:\/\/www.santoshkori.com\/blog\/how-separate-first-post-from-other-in-wordpress-loop\/","title":{"rendered":"How Separate First post from Other in wordpress loop"},"content":{"rendered":"<p>As wordpress freelancer i found way to first post from Other in wordpress loop. Below is php code for same.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n$latest_post = new WP_Query(&quot;post_type=post&amp;posts_per_page=5&amp;orderby=date&amp;order=DESC&quot;);\r\nif ( $latest_post-&gt;have_posts() ) :  $i = 0; while ( $latest_post-&gt;have_posts() ) : $latest_post-&gt;the_post();\r\nif ( $i == 0 ) { ?&gt;\r\n&lt;!-- FIRST POST CODE WILL COME HERE --&gt;\r\n&lt;?php }else{ ?&gt;\r\n&lt;!-- Others POST CODE WILL COME HERE --&gt;\r\n&lt;?php }  \r\n$i++;  \r\nendwhile;  \r\nendif; \r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>As wordpress freelancer i found way to first post from Other in wordpress loop. Below is php code for same. $latest_post = new WP_Query(&quot;post_type=post&amp;posts_per_page=5&amp;orderby=date&amp;order=DESC&quot;); if ( $latest_post-&gt;have_posts() ) : $i = 0; while ( $latest_post-&gt;have_posts() ) : $latest_post-&gt;the_post(); if ( $i == 0 ) { ?&gt; &lt;!&#8211; FIRST POST CODE WILL COME HERE &#8211;&gt; &lt;?php [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[659,661,660,725],"class_list":["post-1301","post","type-post","status-publish","format-standard","hentry","category-wordpress","tag-how-separate-first-post-from-other-in-wordpress-loop","tag-separate-first-post-from-other-in-loop-wordpress","tag-separate-first-post-from-other-in-wordpress-loop","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/posts\/1301","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/comments?post=1301"}],"version-history":[{"count":1,"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/posts\/1301\/revisions"}],"predecessor-version":[{"id":1302,"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/posts\/1301\/revisions\/1302"}],"wp:attachment":[{"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/media?parent=1301"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/categories?post=1301"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/tags?post=1301"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}