Links to posts from a category while on that category page.
-
I’m trying to have it so when I’m on a category page the links in the sidebar are to other pages only from that category and I want to be able to reuse the sidebar template for each instance.
So, say I’m on the page …/category/books the sidebar should list all posts only from that category and when I’m at the page ../category/films I see a menu only for the posts in the category films.
I suppose one solution would be to hard code each category into several sidebars but that would be cumbersome and the user would not be able to create any new categories without me setting up the back end. I need a dynamic solution.I want the code in the sidebar to be able to detect which category page is being displayed and I’m not sure if php can do that on it’s own or if I’d need some kind of javascript/jquery interface to do that.
Any help would be fantastic.
- The topic ‘Links to posts from a category while on that category page.’ is closed to new replies.