Articles of custom taxonomy

Taxonomies in URL

I have a custom post type and two custom taxonomies associated with it. One is locations and the other is activities. How can I form the permalinks in the following format? http://mysite.com/usa/diving Therefore the first one would be the location taxonomy and second would be the activity taxonomy?

Count number of post in Taxonomy?

wp_count_terms() counts the number of terms in a taxonomy but not the number of post that have those terms and I’ve found that wp_count_post() does not accept a taxonomy. So whats a guy gotta do to count the number of post in a taxonomy term? Example: Term: Apples Post: 89 (this is what I want […]

Many to Many Taxonomies or rewrite rules?

Im developing a theme for article directory and i would like to link some way taxonomies to taxonomies. I had a custom post type called “company” with 2 taxnomies Taxonomy #1 is category with terms(shops,workshops,churchs,shoppings,etc) Taxonomy #2 is location with terms(New York, New jersey,Miami, etc) With taxonomy #1 i can do local.dev/category/shops/ to list all […]

Which template name to use for taxonomies but not their terms?

I can’t figure out which template name to use to modify custom taxonomy archive page, but not the one for terms in that taxonomy. My goal is to show terms list in custom taxonomy archive and in custom taxonomy terms – custom post types.. {taxonomy}-{term}.php is used to display custom taxonomy terms ( so there […]

Get taxonomy names by post id

I’m trying to create a single page where I display a few posts on one page. So far so good. Works all fine. Now I display posts in a foreach loop where I check if they are connnected to the page. What I need ist something like wp_get_post_terms($post->ID); but that doens’t work. There are custom […]

Get custom taxonomy description with paragraph tags

I am printing the description for a custom taxonomy of artists with the following code: $terms = get_the_terms( $post->ID, ‘artists’); if ( $terms ) { // loop through artists (could be multiple) foreach ( $terms as $term ) { $termid = ‘artists_’ . ($term->term_id); echo ‘<p id=”artist-bio”>’; echo $term->description; echo ‘</p>’; } } This works […]

How to get next previous category in same taxonomy?

Like WP get_adjacent_post function gives the next and previous post data based on the parameters i want to get the next/previous category data is there any WP built in function which does the right job or i have to write a custom query for that. // Next/previous post example $in_same_cat = false; $excluded_categories = ”; […]

How can I conditionally change the title of a taxonomy meta box?

I’m using the Toolset Types plugin to create various custom posts and custom taxonomies. I have 2 custom post types (Schools, and Productions) that share a common taxonomy (School Subjects). However, on the Schools edit page, I want the title of that taxonomy meta box to say “Subject Wishlist”, while leaving the default title on […]

Dynamically tax_query

I have this for example: $myquery[‘tax_query’] = array( ‘relation’ => ‘OR’, array( ‘taxonomy’ => ‘cities’, ‘terms’ => ‘boston’, ‘field’ => ‘slug’, ‘operator’ => ‘NOT IN’ ), array( ‘taxonomy’ => ‘cities’, ‘terms’ => ‘chicago’, ‘field’ => ‘slug’, ‘operator’ => ‘NOT IN’ ), ); query_posts($myquery); But I would like to make it dinamically, because I have a […]

Recreating the hierarchy of taxonomies for a dropdown form menu?

I have a form that contains a dropdown menu. This form is on a page form.php and is not part of my theme. It exists outside of my site. This dropdown menu contains my list of values for a custom taxonomy called Formats. My Formats are as follows: Entry Form Facebook – Entry Form – […]