Limit have_posts() to one category
-
Hi.
I’m building a media site, and have categories for several portfolio subjects, and I have a blog category. I’d like this blog category to show up on a page I call “Blog” and put that page in the menu to avoid putting a link to the category cause doing this would give a long url with the words archive or category in it. Just to keep the url simple so to speak. This would look better when sharing the link too, justhttps://site.com/blog
instead ofhttps://site.com/category/blog/
I’ve tried working with the permalink structure, but once I go into a category archive the url gets those extra words.So, I’ve made a page called Blog, and I’ve modified a copy of the archive template file and use it as a page-template. Then I added
query_posts( 'cat=3' );
to the code, to make it only fetch the blog category, which it does.The problem is that it doesn’t paginate correctly. There is pagination in the template, but when I go to the next page it shows the same content as on the first page, same posts instead of the next ones.
I’m obviously missing something. Could someone please offer some assistance?
- The topic ‘Limit have_posts() to one category’ is closed to new replies.