Why the idex.php Loop doesn’t work in a page template
-
Hi,
and sorry if my question is really stupid. I’m just trying to understand WP a bit more in depth and the process is not always the smoothest.
I was creating a test page using the standard page.php template and I wanted to display:
? The regular page contents
? Underneath that, the posts as I would see them on the blog home pageIt was just a test, so bare with me if such a page wouldn’t be of much use on a real website.
I thought I could copy and paste the Loop from the index.php into the page.php template and I would have solved my issue. Unfortunately this didn’t seem to output any posts at all. Using WP_Query, query_posts or get_posts would have done the trick instead.
So my question is: why that Loop outputs all the posts on the home page (or index.php) and doesn’t output any post at all if used in the page template?
Big thanks in advance ??
- The topic ‘Why the idex.php Loop doesn’t work in a page template’ is closed to new replies.