$term->taxonomy stripping out underscores

WordPress sees underscore names as relating to post types and dashes as relating to taxonomies. Perhaps this has something to do with it? Also, have you flushed your permalinks recently (change the permalink structure to something else and then back)? It might be stuck in your database with the “sanitized” taxonomy name. This has happened … Read more

How to Get The Taxonomy Term in Custom Post Type Loop Inside a Wp Query

while ( $loop->have_posts() ) : $loop->the_post(); //Edit Width post type $categories = get_the_terms(get_the_ID(), ‘services’); $separator=”, “; if ( ! empty( $categories ) ) { foreach( $categories as $category ) { echo ‘<a class=”cat_item” href=”‘ . esc_url( get_category_link( $category->term_id ) ) . ‘” alt=”‘ . esc_attr( sprintf( __( ‘%s’, ‘your-themes’ ), $category->name ) ) . ‘”>’ … Read more

How to create a list of terms who’s posts also have a predefined external term?

if i understand correctly you want to get a list of albums (posts) of a specific artist(taxonomy) and that are have ihaveit term. if so the its a simple query using tax_query: $args = array( ‘posts_per_page’ => -1, //get all ‘post_type’ => ‘album’, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘artist’, ‘field’ => … Read more

show 10 most recent custom post types excluding the one(s) from specific custom taxonomy

Firstly, your tax query is a little jumbled. The first nested array should actually be at the ‘root’ of your query_posts() argument, with tax_query as a key among them; array( ‘post_type’ => ‘review’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => 10, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘reviewcats’, ‘terms’ => array( ‘featured’ ), ‘field’ … Read more

Add Column to Term Database

I have a feeling that modifying that table is not a good idea. I hadn’t done something like this, but if I needed to deal with considerable amount of meta information for terms I’d try to leverage Metadata API, which for terms would involve setting up separate storage table.

get_the_term_list() wanting to loop through the returned values

I would use wp_get_object_terms which will return an array of object terms that you can manipulate. You also have a little more control with sorting the terms. <?php $terms = wp_get_object_terms($post->ID, ‘work’, array(‘orderby’ => ‘name’, ‘order’ => ‘ASC’)); if(is_array($terms)) : ?> <ul> <?php if(isset($terms[0])) : ?><li><a href=”https://wordpress.stackexchange.com/questions/22940/<?php echo get_term_link($terms[0]); ?>”>Find out more about <?php echo … Read more