post category page construction
-
I’m building a custom template for a photographer’s portfolio. The highlight of the template design is multiple gallery pages relating to different types of pictures she takes (portraits, group shots, etc.) Aside from a separate “featured content” template, all of the sub categories will have essentially the same functionality.
I am going to do this in such a way that each picture in the gallery gets a post of its own, and has its category set to be in the gallery she wishes it to be (a portrait would be in the portrait category, a band in the “group shots” category, etc.)
I would rather not have to create a separate page template for each of the categories, as that would make it a chore for her to add new categories in future if she wished. So, I’m wondering if there’s any way to determine which category has been selected from the navigation prior to calling query_posts()?
Basically, I’d like the functionality to be thus:
<?php $catname = something_to_determine_which_category_was_clicked();?> <?php query_posts(category_name=$catname); ?> <!--loop starts here-->That way I don’t have to build a separate, identical template page for each category she wishes to have. I can build one general gallery page template that pulls posts from the selected category. That seems like it would be a good solution for looking forward.
Any suggestions?
The topic ‘post category page construction’ is closed to new replies.