Custom Field Template within query_posts
-
I’m currently very new to WordPress, so still struggling to figure things out.
I’m setting up a site for a sports tours company. I’ve set up the following basic page structure:
Sports
– Football
> Team 1
> Team 2
> Team 3
> Team 4
– Rugby
> Team 1
> Team 2
> Team 3
> Team 4However, I need to sub-categorise the sports, so that Football has the subcategories ‘European Clubs’ and ‘Domestic Clubs’, and Rugby has the subcategories ‘Northern Hemisphere’ and ‘Southern Hemisphere’. These subcategories do not need to have separate pages, but instead I just want the teams listed under these headings on the Football and Rugby pages.
I’ve installed the ‘Custom Field Template’ plugin, and set up a custom dropdown field called Category, which contains the options ‘Football – European Clubs’, ‘Football – Domestic Clubs’, ‘Rugby – Northern Hemisphere’ and ‘Rugby – Southern Hemisphere’. I’ve then selected the appropriate category for each sport.
Now, what I’m struggling with is how I filter query_post to only display posts from one of the individual Categories.
On each of the sports pages, i.e. Football and Rugby, I’ve currrently got:
query_posts('post_type=page&posts_per_page=-1&&orderby=title&order=asc&post_parent='.$parent);
Is there a way to specify a custom field in query_posts, so that I can make a separate page template for each sport, and just manually query the two categories for each sport? Or, more complicatedly, is there a way to do this while just having one page template for both of the sports? Or should there be a totally different way for me to do this?
I’m not sure how well I’ve explained this, so please don’t hesitate to ask if there’s anything I need to elaborate on.
Thanks,
Chris
- The topic ‘Custom Field Template within query_posts’ is closed to new replies.