Pull in taxonomy links using get_the_terms?

You need to include your html inside the foreach, something like this: $url = site_url(); foreach ( $terms as $term ) { $linklist .= “<h3 id=’Proj_Categories’><a href=”” . $url . “/projects/” . $term->slug . “”>” . $term->name . “</a></h3>\n”; } echo “<ul>” . $linklist . “</ul>”; (I haven’t checked this code…) It looks like you … Read more

Locale switching with a “language” taxonomy

You might be interested in url_to_postid function Used as follows from your wpsx_redefine_locale function: $url = $_SERVER[‘REQUEST_URI’]; $postid = url_to_postid( $url ); Note that this does not return the post id for custom post types but the function is located in /wp-includes/rewrite.php and might be extended if needed. UPDATE: here’s your sample: function my_function(){ if … Read more

Display all posts for taxonomy term across multiple custom post types

You can do this with an array of post types and a tax query for your term. The question you linked had special requirements as only one of the post types used the taxonomy. $args = array( ‘post_type’ => array( ‘books’, ‘movies’, ‘shows’ ), ‘posts_per_page’ => -1, ‘tax_query’ => array( array( ‘taxonomy’ => ‘status’, ‘field’ … Read more

Changing taxonomy term by slug (wp_update_term)

As you hinted in your question, you could use get_term_by() to return an object or array containing the term’s id, then use it to update that term. Something like this should work: $your_term = get_term_by( ‘slug’, ‘your_slug’, ‘your_taxonomy’ ); if ( false !== $your_term ) { wp_update_term( $your_term->term_id, ‘your_taxonomy’, $args ); } References: http://codex.wordpress.org/Function_Reference/get_term_by http://codex.wordpress.org/Function_Reference/wp_update_term

Get posts by term slug only

If you look at source of get_term() it does hard check for taxonomy and for good reasons (caching, collisions, etc). I see two possible approaches: look for term in every appropriate taxonomy until you match try to query for term by search or name__like in multiple taxonomies using get_terms() and work with results

Alter post order on taxonomy template

I’ve assumed that since the posts have already been returned then I should use ‘query_posts’ to alter the order of the posts. That assumption is wrong. You should pretty much never use query_posts. Use a filter on pre_get_posts. function pregp_wpse_108235( $qry ) { if ( $qry->is_main_query() && $qry->is_tax() ) { $qry->set( ‘order’, ‘ASC’ ); } … Read more