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

0
votes
1answer
651 views

Using in 'category_name' in '$query->set();'?

Here's the function I have in my theme's functions.php: function better_editions( $query ) { // Categories act as 'Editions' on my site $get_edition = get_query_var( 'category_name' ); ...
1
vote
1answer
287 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 ...
0
votes
2answers
586 views

When/why does '$query->get( 'tax_query' );' return empty?

First the code: function itsme_better_editions( $query ) { if ( $query->is_category() && $query->is_main_query() ) { $query->set( 'post_type', array( 'post' ) ); ...
0
votes
1answer
239 views

Query set using tax_query with relation 'OR' modifies category object?

(Update: Please see the edits far below.) The code: function itsme_better_editions( $query ) { if ( $query->is_category() && $query->is_main_query() ) { $query->set( ...
0
votes
3answers
115 views

Get a count of how many times a term or a category is used in posts

I need to find out the number of times a term/tag or category is used in a post in WordPress. I wrote the below SQL query. SELECT t.name , count(*)FROM wp_terms t JOIN wp_term_taxonomy tt ON ...
2
votes
1answer
178 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 ...
0
votes
1answer
100 views

Non-Recursive get_term_children()

I have a custom taxonomy called product_category. There are child terms 3 levels down. They look like this: Term1 Term2 Term3 When I am on the taxonomy page for Term1, I wish to use ...
0
votes
1answer
63 views

Custom Taxonomy List with Children

I am trying to display a list of terms for a custom taxonomy and am having a bit of trouble. The custom tax is for a Custom Post Type called project. What I want to do is list a Parent term and it's ...
0
votes
1answer
123 views

Can't pull metadata for a term in my theme's function.php

I have a strange issue where I've attached custom metadata to a Woocommerce product category using the KC Settings plugin and for some reason, I can access the data just fine in a separate plugin that ...
0
votes
1answer
279 views

Getting taxonomy images to display on single-post with their terms

Having some trouble with taxonomy images plugin. I am on single-post.php and I want to display my post's taxonomy terms & the term's associated images. Ideally, I'd like the taxonomy description ...
0
votes
1answer
186 views

List post from current taxonomy children

I have a custom post type and a taxonomy with children, with a template file named taxonomy-productcategories.php. On this i want to list all children with their posts. Child taxonomy 1 Child ...
0
votes
1answer
86 views

Where to populate custom terms in custom taxonomy in plugin?

I have a plugin that successfully creates a custom taxonomy for a custom post type. What I'd like to do, is on activation (or wherever works), create a default set of terms for the custom taxonomy. ...
0
votes
0answers
26 views

How to choose the parent category that shows when using multiple custom categories [duplicate]

When a post is in two or most custom categories, how can I specify the parent category name that I want to show up? An example is the custom post type "tour". It is in the following categories: ...
0
votes
1answer
549 views

Custom Post Type Taxonomy Term Order by Title

I have a custom post type of Clients. The "Client Categories (taxonomy terms)" are called via taxonomy-client.php. I'm able to get the results to output as expected but I can't figure out how to get ...
1
vote
0answers
146 views

Add term to custom post type on draft

I'm trying to automatically add a custom taxonomy term to custom post type when the custom post type of property is created. The action is firing but it is not adding the term. I know it is firing ...
1
vote
1answer
131 views

PHP Code to Display Term URL & Name of a Post Under a Custom Post Type

I am featuring a post in my footer(outside the loop) from a custom post type and am using Advanced Custom Fields plugin to do so. This is the code I am using: <h5>Featured Movie</h5> ...
0
votes
1answer
97 views

List terms of custom taxonomy if matches other taxonomy

So the title is confusing but I can't think of a better way to word it. Basically, I have two taxonomies of "state" and "city" (that have to stay separate for other reasons). Lets say for instance, a ...
0
votes
2answers
473 views

Display all posts that use a custom taxonomy

I'm trying to display all the posts that use a custom taxonomy. I believe the issue is that it is my code is not generating an array of terms. $clients_terms = get_terms('clients'); ...
0
votes
1answer
507 views

Displaying custom post type by first letter through custom taxonomy

I'm trying to make a page on my WordPress website to display all kinds of food through 26 loops. Every loop has to loop a letter of the alphabet, and on top of the page I have links that will link to ...
0
votes
1answer
247 views

How to display custom taxonomy and terms using/creating plugin template

I am working on a plugin which requires a custom taxonomy and 3 terms (Personal, Group & Pets). I already have the taxonomy set up with terms and some sample posts. I've created a template for my ...
0
votes
2answers
87 views

Why is my post categories not displaying?

My post categories are empty. When editing or adding a post they are not displayed in the box. On the /wp-admin/edit-tags.php?taxonomy=category page none of the categories are displayed there either. ...
0
votes
0answers
18 views

Naming convention for taxonomies [duplicate]

I had a taxonomy called: wossom. And I was using taxonomy-wossom.php as the template file that will describe a term of this taxonomy. Now I need to change the name of the taxonomy to wossom-balag, so ...
1
vote
1answer
2k views

Order get_terms() By Custom Field

I want to order my categories like I order my pages. I've added an extra field called Order to my taxonomy, but how do I order my terms by this value? Adding and Saving my Order Value: /** Add New ...
1
vote
1answer
601 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 ...
0
votes
1answer
39 views

How to store category and tags separatly on wordpress?

I am trying to insert data manually on all tables on the back end. I am facing a problem while inserting data to wp_terms. I can successfully insert category into wp_terms and define relationships in ...
1
vote
1answer
1k views

Display the Terms from a Custom Taxonomy Assigned to a Post(inside the loop) in Hierarchial Order

This link tells me how to display categories assigned to a post. How would I modify this code to display the terms from a custom taxonomy assigned to a post in hierarchical order?
0
votes
1answer
144 views

Add custom post type taxonomy tag to article class

Ok, so I have tried about 5 different WP functions now and no luck. Basically here is what I want to do. I have a custom post type called "work", I have a taxonomy within this custom post type called ...
0
votes
1answer
384 views

Hide image if taxonomy term is empty

So I have a Country taxonomy with the country names as terms. The country names are represented by clickable flags (png images) on a map. Now I only want to show flags for terms that have countries in ...
0
votes
1answer
35 views

Show terms in archive page

I am trying to show terms of specific post type on archive page. I don't understand how to "echo" term name. Here is my code: <?php $terms = get_terms("event_cat"); ?> <?php while ...
0
votes
1answer
44 views

Wordpress custom taxonomy

I'm using a custom taxonomy called 'product_cat' and post type called 'product', I'm trying to display all parent terms, child terms and grandchild terms within the taxonomy. So I get a list like ...
0
votes
0answers
77 views

How to get the count for each taxonomy term

I know it is $term[0]->count; However, my terms are placed in the custom menu plugin. My terms are currently structured as Parent Child Parent Child How do I append the term count of each ...
0
votes
0answers
32 views

Get all the contents of taxonomy and sort by term

I'm doing this in a page template. So far, I can query all the contents under my taxonomy. But I need to sort them in terms of their term. Any idea on how to do this? Providing an example would be ...
0
votes
2answers
150 views

How to limit the number of terms (terms acts like categories)

Hello i have created taxonomy in custom post type that act like category. then i have created terms that acts like categories. i have create widget that show all terms from taxonomy. all works ...
0
votes
1answer
182 views

Make Terms Under Custom Taxonomy Use Specific Single.php Template

Yesterday some wonderful people helped me solve the issue here about templates for custom taxonomy terms. Now I have a related question. Again, I have a custom post type set up in my functions.php ...
0
votes
1answer
72 views

How to take list of words and insert them as terms to become tags of a post

I am working on a plugin that will take words with a certain number of characters from a post title and create a list of suggested tags in my Tag Suggester meta box. I have created the function to ...
0
votes
1answer
62 views

How to get all the terms of a post

Here is my code so far: $terms = wp_get_post_terms($event->ID, 'speakers', array("fields" => "all")); print_r($terms); It displays this: Array ( [0] => stdClass Object ( ...
3
votes
1answer
283 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 ...
0
votes
2answers
271 views

How To Display Selected Terms For Custom Taxonomy?

This may be a syntax problem but if so I can't see the problem. I want to select specific terms of a custom taxonomy and display their names. I'm having a problem with the selection process in the ...
0
votes
1answer
100 views

Is altering a default WordPress database table update safe?

I want to add some table columns to the wp_terms table. Is it safe to use the dbDelta function with a modified CREATE-MySQL query for this? Or will I run into problems in the long turn? Is it update ...
0
votes
1answer
334 views

Get all attachments by custom taxonomy - term

I want to make custom taxonomy (gallery) and terms (name1, name2, name3...) Add images into media tab and then retrieve all images from same term. Look like simple task, but I cant manage it. I ...
0
votes
2answers
129 views

Get terms within a custom taxonomy

I need to get an array of all terms within a custom taxonomy where they have a parent term from another custom taxonomy. The example would be I have a custom taxonomy "School" where each term (in this ...
0
votes
2answers
39 views

WordPress Term for Custom List

Would you mind helping me out. I am experienced in programming yet really new to wordpress. I was task to handle this. I just need to know what are these called (The ones with the pin icon): Image is ...
0
votes
1answer
462 views

Display post taxonomies tree

I was able to get all the items of a custom taxonomy for a post, like this: $args=array('orderby'=>'parent',"fields" => "all"); $term_list = wp_get_post_terms($post->ID, 'tvr_amenity', ...
0
votes
1answer
106 views

Insert term description programmatically into hierarchical custom taxonomy

I have following code and I want to specify a term description for each actor and director in $tmdb_actors_arr and $tmdb_directors_arr: // build array $my_post = array( 'post_title' => ...
0
votes
0answers
218 views

Adding a query var to taxonomy term archive - gets redirected to the other taxonomy archive page

I want to pass another query var in the URL through a form while I'm on a taxonomy archive page. The URL would look like so ...
1
vote
0answers
187 views

Same term from custom taxonomy in two different custom post types?

I use a front end form to insert custom post types, an input is used for inserting terms (keywords) to a custom taxonomy for this custom post type. I just noticed in the back-end when I view the ...
0
votes
1answer
119 views

Custom terms inserting as single string with commas, not separated

I have a front end form, one of the inputs asks for a comma separated list of keywords which should each end up being a custom term, I just saw in the backend the terms are entered as single string ...
0
votes
0answers
116 views

Set terms programmatically

I would like to use wp_set_post_terms() or wp_set_object_terms(). I think I read all the codex and all forum post about these functions and I still can't make them work. I've a taxonomy named store ...
1
vote
2answers
1k views

Get posts of ONE taxonomy term of custom post type

I am going crazy here as I assume it is quite simple, but I just cannot get it to work. I have a custom post type called 'portfolio' and a taxonomy called "locations'. In the taxonomy I have various ...
0
votes
1answer
316 views

get multiple values from $_GET from multiple checkboxes

I'm creating a form that loops through all the terms of a taxonomy. Multiple terms can be selected and they get passed in the url. I'm trying to get all the terms on another page but I'm only able to ...