Select default taxonomy on dropdown

This is the following new updated article_type function to make it work: I have removed selected attribute from none option and added selected attribute to that terms having news slug. // This function gets called in edit-form-advanced.php function article_type($post) { echo ‘<input type=”hidden” name=”taxonomy_noncename” id=”taxonomy_noncename” value=”‘ . wp_create_nonce( ‘taxonomy_type’ ) . ‘” />’; // Get … Read more

One taxonomy template for all categories?

I think it’s worth clarifying a bit of terminology first: Taxonomy – a set of related terms Term – an entry (I want to just say “term”) in a taxonomy Categories – a taxonomy that’s in the default WordPress Tags – a taxonomy that’s in the default WordPress Category – a term in the Categories … Read more

Custom taxonomy in short code

Not sure if is this, but you can add taxonomies in query: new WP_Query(array(‘posts_per_page’ => $num, ‘post_status’ => ‘publish’,’taxonomy’ => $taxonomy)); You can filter by term with $taxonomy => $term: $taxonomy = ‘seasons’; $term = ‘spring’ /* $terms = array(‘summer’,’winter’) an array */ new WP_Query(array(‘posts_per_page’ => $num, ‘post_status’ => ‘publish’,$taxonomy => $term)); More on WP_Query … Read more

How to update WordPress custom SQL Select query for custom taxonomies so that syntax is correct?

You should not use a direct SQL query, instead try the WP_Query tax queries e.g.: $args = array( ‘post_type’ => ‘post’, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘category’, ‘field’ => ‘id’, ‘terms’ => array( 22 ) ), array( ‘taxonomy’ => ‘job’, ‘field’ => ‘name’, ‘terms’ => $terms, ‘operator’ => ‘IN’ ) ) … Read more

add_query_arg to look up page title

It depends a bit on what are your exact status slug and title and page title are, but something like this should work, if I understand you correctly: $page = get_page_by_title($status->name.” tickets”); echo ‘<li><a href=”‘.get_permalink($page->ID).'”>’ .$status->name.’ (<span>’.$counts[$status->slug].'</span>)</a></li>’;

Transfer taxonomy to custom field

You can order posts by custom taxonomy terms by adding a posts_clauses filter, see below answer: https://wordpress.stackexchange.com/a/14313/14499 Make sure that on functions.php you add both that function AND the call to add_filter(‘posts_clauses’, ‘orderby_tax_clauses’, 10, 2 );, otherwise it won’t work. Assuming annee is the custom taxonomy, this should then work: query_posts($query_string . ‘&posts_per_page=-1&orderby=annee&order=ASC’);