Trouble with homepage defaulting to a catagory
-
Hi Guys,
I’m trying to make it so a blog I’m developing will default to a particular category when a user types in the root url e.g. http://www.endangermice.co.uk. While I can use the code:
if (is_home()) { query_posts(“cat=945”); }
to make it go straight to the podcasts category, the problem is that the URL doesn’t change to represent the podcasts section i.e. it appears as
and not
http://www.endangermice.co.uk/category/podcasts/
This isn’t a problem until I try to use the next-posts-link and previous-posts-link functions to cycle through pages containing diffwerent posts in the category. If I’m sitting on the home page, the url becomes http://www.endangermice.co.uk/page/2/ when I press the next link generated by next-posts-link. This means that nothing happens since the actual url should be http://www.endangermice.co.uk/category/podcasts/page/2.
How can I make it so that the next-posts-link function will work when I land on the homepage and default to a category?
Hope this makes sense,
Thanks,
Damien.
- The topic ‘Trouble with homepage defaulting to a catagory’ is closed to new replies.