0
votes

I need to make it easy for Wordpress blog posts to be assigned to specific locations of a business so they can be grouped into their own collections for display on blog article archive landing pages for each location. Some articles my be relevant to multiple locations as well.

I cannot use categories for this. Ideally I want something similar to categories, but we're already using 70 other categories on this site for actual post categories. Category blog post archive landing pages will have a wildly different look and feel than the location based landing pages, so categories will not work for this.

I need an alternate approach flexible enough to where it's as easy to assign posts to locations as it is to click a check box for assigning categories to a post, and robust enough that I can indeed create those location-based landing pages that can filter out entries from all other locations.

I'll also need to filter posts by category within a location's entries, if possible.

How can I pull this off successfully?

1
I realize I could create multiple templates targeting just the business locations by category ID if they were categories too, but this would require more effort to maintain, and the locations would still be jumbled into the category heap, which is undesirable.purefusion

1 Answers

3
votes

My initial thought on this would be to use a custom Taxonomy for your blog posts. They function just like Categories (can have archive pages, posts can have multiple taxonomies assigned, etc). We generally use the plugin, Types - Complete Solution for Custom Fields and Types, to manage our Taxonomies. (wordpress.org/plugins/types) If you are already familiar with working with Categories and their archive pages, it's not much different to work with Taxonomies.

The interface works with a checkbox list just like Categories. You set a name, slug, and optional description in the admin side of things. You then assign any number of Taxonomy terms to an individual post. Taxonomies, just like Categories, are just alternate ways to categorize posts. You can use the built-in archive file formats (taxonomy-{taxonomy_name}.php or taxonomy-{taxonomy_name}-{taxonomy_term_slug}.php) to built your template files. So if you had a taxonomy with the slug "locations" and your looking at posts with the term "nort_pole" you could make taxonomy-locations.php or taxonomy-locations-north_pole.php to serve as your templates for the archive pages. You can also use custom wp_queries to sort/filter your posts based on what taxonomy terms are applied to the posts you're looking for.

Here is a good article in the Wordpress Codex that talks about Taxonomies. http://codex.wordpress.org/Taxonomies