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
6k 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
2k 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
282 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
9k 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 ...
5
votes
2answers
552 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
996 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
152 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
1answer
9k 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
210 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
1answer
12k 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 ...
4
votes
6answers
5k 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

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
186 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
208 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
61 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
4answers
6k views

How can I get only parent terms?

Is there any way to get only parent terms from custom taxonomy or category?
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
2answers
912 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
1answer
552 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
533 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
2answers
2k 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 ...
3
votes
3answers
451 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
117 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
290 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
200 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
467 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
1k 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
260 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
4k 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
138 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
561 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
385 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
448 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
416 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
709 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
260 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
552 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
2answers
64 views

Prevent Selected Terms Rising to the Top

When you're editing a post and select a child category or term, and update, the selected terms appear at the top ( leading to potentially confusing situations where 'foo' 'foo' and 'foo' are selected ...
2
votes
1answer
2k views

How to add terms to taxonomy with wp_insert_terms?

I have a huge excel database of locations which I want to add as terms to my current taxonomy. However, I don't know the best way to do this, as inserting manually could take weeks. I have looked at: ...
2
votes
2answers
231 views

Limit tag cloud terms by date

I've been looking for a plugin that limits the tags dislayed in the tag cloud by date. Basically, I want all tags from a certain date forward. I've searched current plugins and haven't found anything ...
2
votes
1answer
543 views

How to hook get_terms() to only show count of posts that have custom meta

Here is what I have: A custom post type that has a custom meta value added to a post that stores the posts expiry date. When the post passes this expiry date it no longer shows on the site. This ...
2
votes
1answer
1k views

How to get the first term for the current taxonomy?

I'm using the following code to display the term for a specified taxonomy: $terms = get_terms( "book_review" ); $category = $terms[0]->name; However I want to display the term for whatever the ...
2
votes
1answer
91 views

When to use 'get_category_by_path' vs. 'get_term_by' to get category object from `get_query_var( 'category_name' )`?

I'd like to retrieve the category object from the category name, using the public query variable category_name, via get_query_var( 'category_name' ): $cat = get_query_var( 'category_name' ); There ...
2
votes
1answer
134 views

Category page only displaying the posts from a custom type

Situation I have two cpt: Projects Works In these two CPT I share the same taxonomy 'Category', and the same terms: Architecture Landscape Interior Design I have URLs like ...
2
votes
2answers
5k views

Display current taxonomy term when inside custom post type

Well, this should be pretty simple, however I couldn't find answer anywhere on the web. all answers I found were close but no exactly what I needed. what I need is to display just the current term of ...
2
votes
1answer
209 views

Glossary with Custom Post Type

I´d like to make a glossary. It should looks like: Index-Nav 0-9 | A B C ... M ... X Y Z B BMW M Mercedes ... ALL entries from index-nav (A-Z, O-9) should be visible in a <ul> and should ...