How to call custom taxonomy categories with shortcodes

Take a look at category post shortcode to get an idea and here is the plugin with minor modifications to call your post type and taxonomy: // Taxonomy category shortcode function cat_func($atts) { extract(shortcode_atts(array( ‘class_name’ => ‘cat-post’, ‘totalposts’ => ‘-1’, ‘category’ => ”, ‘thumbnail’ => ‘false’, ‘excerpt’ => ‘true’, ‘orderby’ => ‘post_date’ ), $atts)); $output=”<div … Read more

How to extract url from get_the_term_list?

get_term_link gives you the link of a particular taxonomy term. $terms = get_object_terms( $post->ID, ‘nom-origin’ ); $urls = array(); foreach( $terms as $term ) { $url[] = get_term_link( $term->slug, ‘nom-origin’ ); //Or do whatever you want here with the url }

Query for posts in 2 taxonomies

According to the Codex, here’s how you would query posts from several taxonomies: ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘videoscategory’, ‘field’ => ‘slug’, ‘terms’ => $custom_term->slug ), array( ‘taxonomy’ => ‘yourothertaxonomy’, ‘field’ => ‘slug’, ‘terms’ => $other_custom_term->slug ) )

How to display Custom Taxonomy of Custom post type

you can get terms in single post type template by using wp_get_post_terms(); inside loop <?php $terms = wp_get_post_terms($post->ID, ‘music’); if ($terms) { $out = array(); foreach ($terms as $term) { $out[] = ‘<a class=”‘ .$term->slug .'” href=”‘ .get_term_link( $term->slug, ‘music’) .'”>’ .$term->name .'</a>’; } echo join( ‘, ‘, $out ); } ?>

Taxonomy landing pages

I can see at least 3 ways to do that. Adding a rewrite rule. See http://codex.wordpress.org/Rewrite_API for details: add_rewrite_rule(‘^(country|person|interest)/?’,’index.php?tax=$matches[1]’,’top’); then use the template_redirect filter to load your template when the taxvariable is there: if (get_query_var(‘tax’)) { # load the template here } You’ll also need to add the tax query var to the list of … Read more

How to create archive page for taxonomy terms within custom post type

There is an example in the WP Codex which should work for you: Try the following naming convention for your taxonomy term archive template: taxonomy-{taxonomy}-{term}.php So, let’s say you have a CPT named “Projects,” a taxonomy named “Maintenance,” and a term within the taxonomy named “Professional.” Then your naming convention would be: taxonomy-maintenance-professional.php

Trying to manage templates on a blog with lots of custom taxonomies

Page templates can be stored within the page-templates or templates subdirectory within a theme, but this does not apply to custom post type or taxonomy templates. Fortunately, the template_include filter can be used to change the template that will be loaded. In the example below, template files are stored in the /theme-name/templates/ directory. /** * … Read more