Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am stuck on trying to create a template page that displays a list of the names in a specific custom taxonomy of a custom post type I created.

The custom taxonomy is locations and clicking on a location like New York, should take you to a list of all the post types that are connected to that location.

I have looked at get_the_terms_list but I have not been able to produce the list. Don't really know what steps and pages I have to create to do all this so any help would be appreciated.

share|improve this question
    
code samples would be appreciated? –  Rahil Wazir Oct 19 '13 at 8:22
add comment

1 Answer 1

I am assiming you already register taxonomy which show you correct links (and generate correct rewrite rules)... but lets make a checklist.

1) Register Taxonomy and assign it to different post types

done by you...

2) Modify a rewrite rules

add_filter('locations_rewrite_rules', 'se_119400_locations_rewrite_rules');
function se_119400_locations_rewrite_rules(){
    $rules = array();
    $rules['location(/?(([^/]+?)(/page/?([0-9]{1,})/?)?)?)$']     = 'index.php?locations=$matches[3]&paged=$matches[5]&post_type=any';
    return $rules;
}

3) Taxonomy template?

Create a taxonomy template taxonomy-locations.php - this will show you a list of posts..

4) Actuall locations list/cloud?

wp_tag_cloud

<?php
 wp_tag_cloud(array('taxonomy' => 'locations'));
share|improve this answer
    
The code can be affected by my framework functionality (i did a tests on dev enviropment with taxonomy location - which is almost same), but in general it working example. –  Oleg Butuzov Oct 19 '13 at 8:21
    
Which page would the code for the rewrite rules go? –  eufracio Oct 19 '13 at 22:46
    
And what page would the code for the list/cloud go? –  eufracio Oct 19 '13 at 22:46
    
rewrite rules to functions.php and the wp_tag_cloud to place where you want to show the locations tags cloud –  Oleg Butuzov Oct 20 '13 at 6:51
    
Awesome! This worked for me. –  eufracio Oct 20 '13 at 21:11
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.