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
8k 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
324 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 ...
7
votes
6answers
10k 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 ?
5
votes
2answers
435 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 ...
5
votes
1answer
14k 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
626 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
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
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
278 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
8k views

How can I get only parent terms?

Is there any way to get only parent terms from custom taxonomy or category?
4
votes
2answers
215 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 ...
4
votes
1answer
11k 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
228 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
6k 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
235 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 ...
4
votes
1answer
193 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
482 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
67 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
2k 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
9k 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
2answers
107 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
650 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
638 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
488 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
121 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
363 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
242 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
499 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
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
1answer
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
295 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
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
1answer
212 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 ...
2
votes
1answer
5k 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
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
2answers
161 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
964 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
587 views

Edit post meta with checkboxes on front end

I'm trying to build an interface so that two custom fields for a custom post type can be edited on the front end with checkboxes. I'd like to display empty checkboxes if neither of those the fields ...
2
votes
1answer
477 views

What hooks/filters are there to alter selected terms on post save?

Very simple, where would I hook/filter to alter the users selection of terms when they save a post (Update or Add)? I need to hook in all instances; such as when saving a post via AJAX, saving when ...
2
votes
2answers
486 views

Are Categories, Tags and Custom Taxonomies any different in regards to SEO?

Simple question, really. I know pretty much nothing about SEO, and i'm trying to define a good structure for this clients online magazine. I already know i'll be using a few custom taxonomies along ...
2
votes
1answer
522 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, ...
2
votes
1answer
754 views

orphaned taxonomy terms remove by sql query

I have 3 custom post types each of these CPT's have posts that are set to auto delete via a given time scale by cron jobs, thing is when they are deleted it leaves behind orphaned taxonomy terms in ...
2
votes
1answer
300 views

post count is wrong when using same taxonomy for 2 different CPT

1 custom taxonomy registered for 2 different CPT (custom post type). When i entered to edit tag section on edit-tags.php?taxonomy=mytaxonomy&post_type=cpt1 it displays total post count of 2 ...
2
votes
2answers
653 views

wp_update_term: How could i update the “name”?

I was just looking at wp_update_term and haven't found any possibility to update the "name" of the term. My scenario is pretty simple: I got some predefined taxonomy terms in a config file like this ...
2
votes
1answer
25 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
1answer
35 views

Does WordPress Offer a Way to Find All of the Categories that Don't Have Children?

Background As discussed in Is There a Difference Between Taxonomies and Categories, taxonomies refer to a generalized system of classification and organization of objects or data. In the case of ...