Problem with index only showing the same five posts
-
I’m currently adding old news posts to my WordPress blog (they were all written in HTML files), and so far I’ve got one problem. It’s that’s bugging me, and I can’t figure out why it’s happening.
For reference, my website is located at https://vice.parodius.com/index.php
I edited the index.php template with the following code at the top:
<?php if (is_home()) {query_posts("cat=4&order=DESC");}?>
What this does is get all the posts that are filed in the news category, and list them in reverse order. I did this so posts with different categories would not show in the main index. So far so good, right? Well, I’ve added six entries with a news category. Go to the link I posted above, and everything works fine, until you click on the Next Page– link. If you do that, you get the same five posts in the index, and a link to go back at the bottom.
Note that this does not happen if you go to https://vice.parodius.com/category/news/ – the next page link works just fine there.
Now, I think I know why this happened. Since the code I posted above is inserted into the main template, it will always list the first five posts in the news category. But I’m too clueless to figure out how to fix this, or if there’s another way of doing this.
Can anyone help me? Thanks!
(Edited to add: I set WordPress to only show up to five posts per entry. My problem is not the amount of posts per page, but the fact that it doesn’t go to the next five posts when I click on next page. Apologies for not being clear about it.)
- The topic ‘Problem with index only showing the same five posts’ is closed to new replies.