Filtering custom taxonomies

This is not a tought quest, but you’d have to read carefully the Codex. Especially tax_query part of WP_Query. Your proposed query_posts call is wrong. This should look like this: query_posts( array( ‘post_type’ => ‘myportfoliotype’, ‘paged’ => $paged, ‘posts_per_page’ => 80, ‘tax_query’ => array( array( ‘taxonomy’ => ‘category’, //or tag or custom taxonomy ‘field’ => … Read more

How to assign multiple roles for capabilities array withini register_taxonomy function?

When assigning capabilities to ‘capabilities’ argument of register_taxonomy() you need to assign the capability and not the role! so use capabilities that only a specific role has eg: ‘capabilities’ => array ( ‘manage_terms’ => ‘manage_options’, //by default only admin ‘edit_terms’ => ‘manage_options’, ‘delete_terms’ => ‘manage_options’, ‘assign_terms’ => ‘edit_posts’ // means administrator’, ‘editor’, ‘author’, ‘contributor’ )

Include and Exclude Taxonomies From Archives & Feeds Using ‘pre_get_posts’

I’ll take another shot. The following should modify the main query, such that it will include in its loop any posts that belong to no term of the Edition custom taxonomy. add_filter(‘pre_get_posts’,’better_editions_archive’); function better_editions_archive( $query ) { if ( $query->is_tax( ‘edition’ ) && $query->is_main_query() ) { $terms = get_terms( ‘edition’, array( ‘fields’ => ‘ids’ ) … Read more

How to display custom taxonomies in posts?

The easiest way to list terms of custom taxonomy and display them would be to use <?php get_the_term_list( $id, $taxonomy, $before, $sep, $after ) ?> For example in the loop, my custom taxonomy is ‘jobs’ list as li <ul><?php echo get_the_term_list( $post->ID, ‘jobs’, ‘<li class=”jobs_item”>’, ‘, ‘, ‘</li>’ ) ?></ul>

Custom Post Type and Taxonomy URL rewrite

I have used my jewelery post type bellows code, You can just replace your post type & taxonomy. Just copy & paste on your functions file. <?php //Register a Jewelry post type. function jewelry_post_register() { $labels = array( ‘name’ => _x( ‘Jewelries’, ‘post type general name’, ‘twentytwelve’ ), ‘singular_name’ => _x( ‘Jewelry’, ‘post type singular … Read more

How to pass URL parameters for advanced taxonomy queries with multiple terms for one custom taxonomy

After adding print_r($wp_query); to my template and examining the results, I have discovered URL formats that work. I wrote, in my question, that the following format doesn’t work — in fact, it does – if you spell your custom taxonomy name correctly. example.com/?ctxname=term1+term2 Pretty URLs with the ‘+’ and ‘,’ operators (indicating AND and OR … Read more