{"id":7520283,"date":"2016-06-27T09:37:23","date_gmt":"2016-06-27T09:37:23","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/beginnerwork-with-wordpress-post\/"},"modified":"2016-09-01T16:01:31","modified_gmt":"2016-09-01T16:01:31","slug":"beginnerwork-with-wordpress-post","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/beginnerwork-with-wordpress-post\/","title":{"rendered":"[Beginner]Work with WordPress Post."},"content":{"rendered":"<p>Hi everyone \ud83d\ude42<\/p>\n<p>First, if I&#8217;m in the wrong section, sorry.<br \/>\nMy problem is that I try to get the last post on one page, and all the post in other one.<\/p>\n<p>I have create two page in the wordpress interface and have attach them a different model.<br \/>\nThe first model is for the index page, where I just want to get and show the last post, and the second is the actuality page, where i try to get all the post.<\/p>\n<p>But I didnt have find how to do.<br \/>\nI have check on the codex how they do, but when I have try, that doesnt work.<br \/>\nNothing was visible.<\/p>\n<p>Was something like :<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">if(have_post()) : while(have_post) : the_post()&lt;br \/&gt;\nthe_content();&lt;br \/&gt;\nendwhile;&lt;br \/&gt;\nendif;<\/pre>\n<\/p>\n<p>But really dont work. I think I&#8217;m doing something bad, like my actuality page model should be like :<\/p>\n<p><pre class=\"brush: plain; title: ; notranslate\" title=\"\">get_header();&lt;\/p&gt;\n&lt;p&gt;&quot;the loop juste before&quot;&lt;\/p&gt;\n&lt;p&gt;get_footer();<\/pre>\n<\/p>\n<p>This should be a very simple sample for understand how that work but..<br \/>\nIf someone can explain me, not juste copy past a solution, for how I can get only the last post, and get all the post, it will be very nice.<\/p>\n<p>Thanks for read and sorry for that &#8220;anglish&#8221;, I&#8217;m French.<\/p>\n","protected":false},"template":"","class_list":["post-7520283","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/7520283","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\/7520283\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=7520283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}