In WordPress, terms are itens set to a taxonomy, i.e. when you create new categories or tags you create new terms.

learn more… | top users | synonyms

15
votes
8answers
9k views

How to show a hierarchical terms list?

I have a hierarchical taxonomy called 'geographical locations'. It contains continents on a first level, and then the countries for each one. Example : Europe - Ireland - Spain - Sweden Asia - Laos - ...
10
votes
5answers
3k views

Inserting terms in an Hierarchical Taxonomy

I'm really having a few issues with inserting terms. Here is my scenario: I have a taxonomy called veda_release_type: //Release Type and Region $labels = array( 'name'=> ...
10
votes
2answers
356 views

Hierarchical taxonomy UI

I don't like the way the taxonomies are displayed within the Wordpress admin and was wondering if anyone knew the best way to hook in and change it. Currently if I select some terms within my post ...
8
votes
2answers
1k views

Is There a Difference Between Taxonomies and Categories?

I've been reading the codex for WordPress closely and am confused about the vague definitions between what a Taxonomy is and what a Category is. For that matter, term is also a word that is used in ...
8
votes
6answers
11k views

Get terms by taxonomy AND post_type

I have 2 custom post types 'bookmarks' and 'snippets' and a shared taxonomy 'tag'. I can generate a list of all terms in the taxonomy with get_terms(), but I can't figure out how to limit the list to ...
6
votes
5answers
4k views

How to export and import taxonomies (category, tag and/or custom taxonomy) and their terms

I want to export all Wordpress categories (no posts, just categories) from one blog to another. How can I do that ?
6
votes
1answer
3k views

What is 'term_group' for 'order_by' in get_terms()?

I was just reading the Codex regarding get_terms();. What exactly is the parameter 'term_group'? You can use it in (example): 'order_by' for get_terms();. Hint: I could be all terms that share the ...
5
votes
2answers
296 views

Passing a hardcoded page/post ID into `get_post`

I see people using this to pull in page content on their home pages, remove specific categories from archives etc.. e.g. $post = get_post( 5 ); Someone suggested this was bad practice. Why is it ...
5
votes
2answers
126 views

Get The Post Type A Taxonomy Is Attached To

Being given a taxonomy or term, is is possible to pull any / all post types the taxonomy is attached to? For example, knowing the built in taxonomy category or being given a term in the category ...
5
votes
1answer
15k views

Get Posts by Custom Post Type ,Taxonomy, and Term

Ok, so i have a Custom Post Type called "Services". This custom post type has a taxonomy called "Areas" and there's 5 terms in that taxonomy. Let's say I have 10 posts on "Services" and there's 5 ...
5
votes
2answers
689 views

Is there a way to 'Lock' a Taxonomy?

I was wondering if there was a way to prevent the addition of new categories into a taxonomy, essentially 'locking' the taxonomy. I'm programatically registering a taxonomy and filling it with terms ...
5
votes
1answer
267 views

Why does WordPress combine a term with the same name in the wp_terms table?

Add a term for a certain taxonomy with the name: Test Add another term for a different taxonomy with the same name: Test In the wp_terms table you find one record for both terms. In the ...
5
votes
1answer
107 views

Can I lock down custom taxonomies on a parent term level, but not a child term?

I've created a taxonomy called "topics" which has 4 top level terms: science environment technology cant remember the last one and each of those terms will have child terms. I want to be able to ...
5
votes
1answer
1k views

How can I create a taxonomy meta-box with search suggestions but no new terms input?

I was wondering how I could setup a taxonomy metabox on a post edit page that would be similar to the "tags" kind (with search field and automatic suggestions), but without the right to add a new ...
5
votes
1answer
350 views

Slow wp_term_relationships query

I'm running a large WP instance (currently has 28,000+ posts in custom types) and have been experiencing some odd slowdowns. Upon analyzing the MySQL slow query log, one of the problem queries is: ...
4
votes
4answers
9k views

How can I get only parent terms?

Is there any way to get only parent terms from custom taxonomy or category?
4
votes
1answer
12k views

How to get a taxonomy term name by the slug?

If I know a taxonomy term slug, how can I get that term's name?
4
votes
1answer
244 views

Large taxonomy (2000+ terms), causing WordPress to hang

I have a large taxonomy (and about to grow a lot larger) with several thousand terms in it. When I'm editing a post, there is now a significant hang when it goes to load the term list. Has anyone run ...
4
votes
6answers
7k views

Custom order of terms for custom taxonomy in admin and website

I have a custom taxonomy registered for my custom post type. I need to make it possible for a user to specify the order in which the taxonomy terms should appear (something like menu order for pages). ...
4
votes
1answer
201 views

List Hierarchical Term List with Count with Related Term

What I have are custom posts (of a custom post type, wps_business) that have two taxonomies (wps_location & wps_type), and I would like to list all the terms from type of a specific location. For ...
4
votes
3answers
899 views

Best pratice to make taxonomy terms translatable without changing slugs?

I have one custom taxonomy with countries and states. I'd like to make these terms translatable but I'm not sure what would be the best way to achieve this. First of all, I don't want the slugs to ...
4
votes
1answer
80 views

How to sort terms with diacritical signs?

I have list of terms which happens to be the Polish Alphabet. Here's how I list these terms: <ul> <?php $terms = get_terms("taxonomy", array('orderby' => 'title', 'hide_empty' => ...
3
votes
1answer
284 views

How to prevent new terms being added to a custom taxonomy?

I've created some custom taxonomies using register_taxonomy, but I want to prevent new terms from being added. I noticed that there is a 'capabilities' argument available in register_taxonomy, is that ...
3
votes
1answer
3k views

How to get_term_children output in alphabetical order?

How do i get output of this in alphabetical order <?php $termID = 5; $taxonomyName = 'area'; $termchildren = get_term_children( $termID, $taxonomyName ); echo '<ul>'; ...
3
votes
3answers
11k views

get_posts assigned to a specific custom taxonomy term, and not the term's children

Say I have the following taxonomy terms: Term 1 Term 1.1 Term 1.2 Term 2 Term 2.1 How can I get only posts that are assigned to Term 1 and not include those that are assigned to Term 1.1 or ...
3
votes
2answers
1k views

get term by id without taxonomy

Can I get the term by it's id without knowing to whish taxonomy it belongs? I have a meta field that stores term ids, but doesn't store the taxonomy. However, all the get_term function have taxonomy ...
3
votes
3answers
187 views

I have a term_taxonomy_id — is there an API call to get the taxonomy?

Issue: I have the term_taxonomy_id, I do not have the taxonomy name, I want to retrieve the term object without doing a direct database query. Thoughts: Well the API docs for get_term_by say that ...
3
votes
1answer
691 views

Determine if Term has Grandparent/Great-Grandparent

I have a custom taxonomy (hierarchical) for which I'm outputting the results. For example's purpose: --Drinks ----Tequila ------Reposado ------Blanco ----Beer & Wine ------Beer ------Wine ...
3
votes
2answers
2k views

wp_get_object_terms() to get a list of all the terms attached to all the posts in the current query

How can I use wp_get_object_terms() to get a list of all the terms attached to all posts in the current query? For example, for the current query I want to get an array of the terms from the "Alfa" ...
3
votes
1answer
631 views

Control term order on a per-post basis

I have a taxonomy in which term order matters, but varies from post to post. So I want to be able to set the order that terms are displayed in on a per-post basis: My first post | Tagged: Apples, ...
3
votes
1answer
724 views

Is there a filter/action to add content to WP admin metaboxes?

I want to add an instruction into a custom term meta-box. Is there a hook to add this or is it easiest just to use JavaScript?
3
votes
3answers
525 views

Exclude Child Terms From Parent Posts

How can I exclude the child term posts from showing up in the parent term posts output?? Right now it's duplicating in both parent and child term outputs. //Function to display posts grouped by ...
3
votes
1answer
41 views

Modify Term Update Redirection

Whenever I update a term it currently redirects me back to the edit-tags.php page for that taxonomy, the term list. Is it possible to instead of redirects to the term list to instead bring me back to ...
3
votes
1answer
123 views

Excluding posts from a category but only if they're not in multiple categories

I am looking to exclude a category in Wordpress. I am referring to the Wordpress Codex page on wp_query but I am having the following problem: I want to exclude posts from category 1, but if a post ...
3
votes
1answer
420 views

Retrieving custom taxonomy in order, but excluding specific tax IDs

I have a function set up and working based off the discussion in this thread: Custom taxonomy, get_the_terms, listing in order of parent > child. My version includes term links and allows me to ...
3
votes
2answers
270 views

Taxonomy slug by term ID

I'm trying to modify wp_nav_menu to display term thumbnails. To get those thumbnails I need term ID and taxonomy slug: $thumbnailimg = get_the_term_thumbnail($term_id, '$taxonomy', 'medium'); I ...
3
votes
2answers
516 views

Copy a Taxonomy Term into the Post Title for a certain Custom Post Type

I am using Gravity Forms to allow users to create posts from the front end. However, the way this site I am building is going to work, one specific Post_Type is essentially just a "Data" post. There ...
2
votes
4answers
6k views

How can I remove links from the function “get term list”?

<?php echo get_the_term_list( $post->ID, 'people', 'People: ', ' ', '' ); ?> returns something like this: People: <a href="person1">Person1</a>, <a ...
2
votes
2answers
2k views

Fast way to add countries as a custom taxonomy term?

Is there a quick way to add a list of countries as terms to a custom taxonomy called "Country"? Is there an existing import file, SQL script ect... I don't want to be there all day manually adding ...
2
votes
5answers
11k views

How to get current term in my custom taxonomy in WordPress?

I need to display the current term in my custom taxonomy in a single post. example: My custom taxonomy is products and term of them is product-1, product-2 and products-3. My post is assigned to ...
2
votes
2answers
2k views

Formating the_terms() function output

This code: <?php the_terms($post->ID, 'type') ?> Gives: <a href="/archives/type/image" rel="tag">Tag</a> What do to if I want to display only "Tag" word, not link eg. Tag ...
2
votes
1answer
316 views

Get terms that contain posts that in turn belong to other terms?

So I have custom taxonomy called "shape" and another one called "color". If I want to get the list terms under shape that contain posts that are also present in terms under color, how do I do that? ...
2
votes
1answer
6k views

How to only list the child terms of a taxonomy and not their parents?

I'm creating an age select menu in the admin, populated from a taxonomy of age. The taxonomy is hierarchical as follows: 18-25 (parent, ID 183) 18 (child) 19 20 21 22 23 24 25 26-30 (parent, ID ...
2
votes
1answer
1k views

Checking if a Page has an Associated Term?

I am looking for a way to do some conditional logic on terms associated with a post. Essentially I created my own custom taxonomy for "age groups" and have created three terms for them. Kids, Teens, ...
2
votes
3answers
4k views

get taxonomy name of current post

Hierarchical taxonomy of custom post type 'projects' > 'projects_category'. Two example 'projects_category' hierarchies would be: Big Corporates > 1st Company Name > A Post Title Small ...
2
votes
1answer
2k views

How to Get All Taxonomies AND All Terms For Each Taxonomy With Post Count Zero

Is there an easy way of obtaining every registered taxonomy and for each registered taxonomy, get all the terms for that taxonomy, and for each term, get the post count, without actually fetching all ...
2
votes
2answers
182 views

deleting terms programmatically

I already checked out this page; http://codex.wordpress.org/Function_Reference/wp_delete_term It does not say what happens to the posts that may have been associated with this action. Hence my ...
2
votes
1answer
1k views

Custom taxonomy term as class?

I'm trying to add a class to a container within a query, ideally I'd like to use the terms from a custom taxonomy I have setup (guide-categories). As an example: <div class="myclass *taxonomy ...
2
votes
1answer
45 views

Show posts without term

I am working on a product page where I show reviews from my post type 'reviews', if the product page title matches with my term from the taxonomy 'review-product'. Example. Product page title: ...
2
votes
2answers
9k views

Display all the subcategories from a specific category?

I need to show all subcategories using $product_category = wp_get_post_terms( $post->ID, 'product_cat' ); actually I use: <?php global $post; $terms = get_the_terms( $post->ID, ...