Display posts on a page template
-
Hi guys,
I’m struggling to get some basic principles here. I have been reading he Codex here and there and in the Pages section I see an example that shows how to display posts inside a page. I have managed to tweak it a little bit, still way to go, but I’m afraid I don’t really know what I am doing. I’d prefer to understand properly. Therefore my question:
I am studying WP a little bit and I’m trying to create a Staff page that display a title, some content and a list of employees with a portrait and a biography for each of them.
In order to make them “dynamic”, I have used posts to create employees (all under the category “Staff”), then I have created my page and my page template (staff_page.php) and all is fine until I get to the Loop. I initially pasted the index.php Loop hoping to then tweak it (to only list the -Staff- category posts), but the Loop was not even showing up. Then I’ve found a Loop on the Page Codex section which makes use of the wp_query class, which is not very simple to grasp.
To cut the long story short, can’t I just use the index.php Loop on pages to display posts? Do I need to use different specific tags and functions? Also, the page content itself seems to be generated by a Loop which “talks” about “posts”, has posts etc. What is the difference between pages and posts in this regard?
Many thanks
- The topic ‘Display posts on a page template’ is closed to new replies.