Category Specific Menu
What i would like to do is create a menu on my category pages are regular category pages, that figures out what the current category is and display the posts under that category.
ex// If i have 10 caetgories and the user clicks on the design category, when they are on the design category page I would like to display a menu that shows the other posts that are under the design category.
I’ve searched and search on this and I just can’t seem to figure out of if this is possible, I know if the design category was a specific page there would be lots of ways to do this because I could set a template tag or a plugin to display a specific category id, but since it is dynamic is there a way to store the category id in a variable and then drop that variable into.. something like this:
$posts = get_posts(‘numberposts=10&order=ASC&orderby=date&category=”%categoryidvariable%”‘);
foreach ($posts as $post) : start_wp(); ?>
<?php the_title(); ?>
<?php endforeach; ?>
I think this would make it dynamice depending on the page.. I’m not a php expert and I’m not sure how to store the category id in a variable… or if this is even possible.. any thoughts??
- The topic ‘Category Specific Menu’ is closed to new replies.