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

2
votes
2answers
1k views

Importing data from spreadsheet into wordpress DB, along with custom taxonomies and their terms

I am importing a large DB from an Excel spreadsheet into a wordpress DB. I was going to do it manually by creating a new table but decided to import it into the existing wordpress framework as it will ...
2
votes
1answer
2k views

Generic taxonomy-term template page

because of my taxonomy hierarchy, my taxonomy-type.php template is already used, is there a way to have only one taxonomy-type-term.php template ? I've got 13 sub terms, do I need to create 13 ...
2
votes
1answer
320 views

Why does WP rename similar “term name”-slugs in separate taxonomies?

I have several custom taxonomies and within two of those ( Company Categories and Photographer Categories ) I have a term that is similar. The Company Category called Boudoir and the Photographer ...
2
votes
4answers
2k views

wp_set_object_terms() Fails to Set Terms

Okay guys, here's the scenario. I'm am trying to setup a function that will automatically duplicate a post (when published) over to another post type. So, a regular blog post is published, and when ...
2
votes
1answer
109 views

wp_insert_term doesn't work with custom post type's taxonomy

Here is the problem I am having: I have a custom post type called "weddingguests" This custom post type "weddingguests" has a custom taxonomy, "friendsof", hierarchic I want to programmatically ...
2
votes
2answers
335 views

Dropdown: Display terms from B only if has relationship with a term A selected

I've googling for a solution for this issue and found nothing: I have some posts from a Custom Post Type (Restaurants) and its taxonomies ('city' and 'cuisine'). Whenever I create a restaurant post, I ...
2
votes
0answers
144 views

How to display term description in empty terms archive?

I list all terms from a taxonomy, even the empty ones, but I found out that at least in 2010/2011 themes I got a 404-like message, the default seems to only display the term description when at least ...
2
votes
1answer
60 views

How can I get WP to build a feed based on multiple taxonomy terms

Currently, the best way to get a feed generated for a single taxonomy term is by letting wordpress generate the content automatically: example.com/wordpress/feed?tax_slug=term_slug However, is ...
1
vote
3answers
4k 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 ...
1
vote
5answers
8k 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 ...
1
vote
1answer
135 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 ...
1
vote
3answers
2k views

Is there a way to import terms into Wordpress?

I'm tired of typing in lists of counries in my "Countries" taxonomies. What's a good way to bulk import a long list of terms into Wordpress ?
1
vote
2answers
326 views

get_terms with more than x post count

Is there an argument for get_terms which I can fetch terms that only have say over 2 posts associated with it? I have a terms page which lists all my terms for 'artists', the page is huge but a lot of ...
1
vote
3answers
7k 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 ...
1
vote
2answers
202 views

Have a Custom Post Type index page display taxonomy items instead of posts

I have a CPT registered that is called lessons with a custom taxonomy (category) that is called courses. I want the /courses page (archive-courses.php?) to display the individual courses (i.e. "online ...
1
vote
2answers
159 views

Creating a function that receives the taxonomy terms that have been changed in a custom post type

Ive been looking into actions and hooks etc... from wordpress, but cant seem to do a very simple thing. I just want to execute a function whenever a post is updated, and within the function I want the ...
1
vote
1answer
857 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 ...
1
vote
2answers
161 views

Check if term is in a taxonomy?

Is there a function that does something like: is_in_taxonomy($term, $taxonomy) Where it returns true if $taxonomy has that $term. ???? Thanks!
1
vote
1answer
3k views

If on term-page -> get the current term?

I'm trying to write a kind of "breadcrumb" function in my "functions.php" I'd like to query if I'm on a term-page and if so I want to print the current term I'm in. By "term-page" I mean the ...
1
vote
2answers
314 views

What is the difference between terms and tags?

I am working on a problem to get the most recently used tags within the last 30 days. My current thought process is not working, so I am trying to come up with an alternative method. I came across ...
1
vote
2answers
264 views

How to list 2 taxonomy terms for a post, based on their hierarchy

I'm using get_the_terms to display 2 terms on a post, associated with the taxonomy "location". The terms are the suburb and the city. The location taxonomy is hierarchical so the suburb is a child of ...
1
vote
2answers
421 views

List Terms in Category

I want to list all terms of a specific taxonomy used in a category. Like I have a taxonomy called 'Manufacturer' and a category 'Shoes'. Each post in this category has a term like 'Nike', 'Adidas' or ...
1
vote
1answer
1k views

Fixing category count

Somehow my post counts are incorrect due to inserting rows via php. I have the following code to update the count, is it correct? global $wpdb; $result = mysql_query("SELECT term_id,term_taxonomy_id ...
1
vote
1answer
283 views

Operations with custom fields values in a loop

I have a foreach for displaying all the post in one taxonomy filter by terms. I have a custom field for display a numeric value. What I need, is to make two math operation with all the values of that ...
1
vote
1answer
578 views

Why is my WP_Query not working when tax_query terms are an array?

I have an issue with a WP_Query for a site I'm building which has me stumped. This works as expected: $package_args = array( 'post_type' ...
1
vote
1answer
254 views

Handling duplicates with wp_insert_term()

I'm using wp_insert_term which works quite well Now I want some error handler for when using the same name. $term_id = wp_insert_term( $term, 'wpsc_product_category', $args ); if($term_id) {//my ...
1
vote
1answer
475 views

Does WordPress limit the length of slug names for Post Meta or Terms?

The WordPress Codex states the the Post Type Names and Taxonomy Names have a limit to the slug name. Register Post Type -- max. 20 characters, can not contain capital letters or spaces Register ...
1
vote
1answer
84 views

Add a term to an attachment submitted from front end

I have a front end post form where users can upload a file with their post that I save as an attachment using media_handle_sideload(). I need a way to add a term to that attachment so I can show a ...
1
vote
2answers
133 views

Strict tag list - user should choose only existing tags for posts

While selecting tags for the posts the user is able to create new tags on fly. For example we have the tag 'animal' but the user misstpye it as 'aminal' - and Wordpress creates it. In our blog the ...
1
vote
1answer
1k views

get_term_children doesn't return an array of children terms

I am trying to get the term children and then check if they exist to display them. But I get no IDs in return of get_term_children command. This is the code: $children = ...
1
vote
1answer
45 views

How do I determine if a certain term is in an array?

I am currently running the below wordpress php and it is creating a list for me. $term = get_term_by( 'id', $ptc, $taxonomy ); echo '<li><a href="'. home_url() .'/taxon/'. $pt->slug .'/' ...
1
vote
1answer
706 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 ...
1
vote
1answer
629 views

Displaying terms by first letter

I run a book review blog and I have multiple pages that lists the reviews by different things (rating, book title, and author) I have custom taxonomy for authors and I basically have my code list all ...
1
vote
1answer
216 views

Changing stylesheet depending on custom taxonomy terms

My client would like the background & header colors to switch depending on terms within the custom taxonomy 'Grades'. These terms are kindergarten, first grade, second grade, etc... (all ...
1
vote
5answers
432 views

How to associate an image with a term taxononmy and publish it on frontpage?

I couldn't find the solution anywhere else, so I believe is a valid question for this website. I think my problem is divided in two parts. I created a custom taxonomy called "Type" and within it, I ...
1
vote
1answer
1k views

tax_query operator woes

I am trying to filter posts by multiple taxonomies. My code below works great, but their is one thing I can't quite figure out. When I filter the posts it seems that they only show the posts that ...
1
vote
2answers
348 views

WordPress built-in method to extract array of term IDs?

I'm querying a custom taxonomy for a post, hoping to get a list of all terms for that post and taxonomy. get_the_terms($post_id, $taxonomy) works, but gives this ungodly array of term objects that ...
1
vote
1answer
47 views

Determine Term depth

I'm looking to be able to find the depth of a term within it's hierarchical tree. Produce -- Vegetables ---- Carrot ---- Onion ---- Celery -- Fruit ---- Apple ------ HoneyCrisp ----Orange Produce ...
1
vote
1answer
255 views

Changing taxonomy term by slug (wp_update_term)

What I am trying to accomplish is to update a taxonomy term name using its slug rather than the $term_id Wordpress does this by: <?php wp_update_term( $term_id, $taxonomy, $args ) ?> Is it ...
1
vote
1answer
415 views

Getting Term ID from Term Name for WordPress Query

I am trying to get term ids from term name and cannot figure out why this code is not working. $excludes = ''; if($filtering_excludes) { $exclude_terms = explode(", ", $filtering_excludes); ...
1
vote
1answer
133 views

Echo custom taxonomy term name

I would like to echo out the term name from a custom taxonomy 'recipes' but all I get is the word "recipe" when it should say eg "pizza recipe". Is name the right argument here or I am mistaking it ...
1
vote
1answer
303 views

How to determine the depth of a term in a custom taxonomy?

I'm building a <select> dropdown to display a list of terms for a custom hierarchical taxonomy. How do I know the depth of each term? I'd like to add some indentation for child-terms (the more ...
1
vote
1answer
116 views

Filter taxonomy terms using multiple id in the edit-tags.php

I want to use the edit-tags.php search function with multiple term id's. For example, if i type into the searchbox something like this: #1245&6832, it should display these two terms in the results ...
1
vote
1answer
199 views

How to Make a Category Always Selected?

I'm trying to write a function to make certain terms of default category always selected. When the user is writing a new post, the term checkbox should be checked and he shouldn't be able to unckeck ...
1
vote
1answer
88 views

How to get a list of taxonomy terms which are being used only within certain post types?

I have a custom taxonomy called 'locations' which is being shared across a bunch of post types. I want to make a select field dropdown list of my locations (terms) to let users go to the taxonomy term ...
1
vote
1answer
887 views

Get second level terms of custom taxonomy

I want to get second level terms of a specific parent (first-level) term in a custom taxonomy. Sounds complicated but would be useful. Term 1 SubTerm-1.1 SubTerm-1.2 SubTerm-1.2.1 Term 2 ...
1
vote
3answers
6k views

Get main parent categories for a product

Can someone please help me, I'm looking for a way to find the main parent product category of a WooCommerce product? Say, the product is marked under Gadgets, but the main parent of them all is ...
1
vote
1answer
220 views

Displaying terms based on loop posts?

I have a shortcode that shows a loop for a custom post type: while ( $loop->have_posts() ) : $loop->the_post(); // do something endwhile; Some of the posts are in categories ...
1
vote
1answer
377 views

Set attachment tags from attachment's custom field data

I currently have a custom field added to my attachment's form called artist_credit using the hook attachment_fields_to_edit. When a person enters a name into the artist credit field, I want it to (if ...
1
vote
2answers
216 views

Count posts for each taxonomy term for each month

Cannot figured it out... I need to count how many posts there are for each taxonomy term form each month.