Retrieve the terms in a taxonomy or list of taxonomies. Returns an array of term objects, or a WP_Error object if any of the taxonomies to get terms from does not exist.

learn more… | top users | synonyms

0
votes
0answers
22 views

How to get custom posts sub category link

I'm trying to echo custom posts sub category link as a view more option.For the last week, i am trying to do that, but i just can't find the right way. I've tried, category links, terms, with args, ...
0
votes
1answer
13 views

How to get term by name with parent id?

So I have two menus which has childs with the same name. How to get term by name but from specified parent?
0
votes
0answers
54 views

Need help with a foreach loop with custom post type and taxonomy

I am looking for help with a foreach loop for taxonomy inside of a custom post type. Please note, my php skills are poor. The goal is to have a custom post type (CPT) called retail location that has ...
1
vote
2answers
72 views

Change link in get_terms if there is only one post in the category

I created a shortcode that will list the categories in my custom taxonomy and will return a list of all the categories that have at least 1 post (not empty). The result is that when someone clicks on ...
1
vote
2answers
26 views

Ordering Taxonomies / Changing term_id

I have a site where there are nearly 200 series (custom taxonomy) and roughly 10 items (posts) in each. Each series is called 'Name: Series Number - One liner bout the series'. When I use get_terms ...
0
votes
0answers
10 views

query term by name with quote inside

I need to fetch a term by names that may contain single quote: $my_names = $_POST['my_names']; var_dump($my_names) // array(1) { [0] => string(14) "Chef d\'oeuvre" } //$my_names = ...
0
votes
0answers
24 views

get_the_terms is not working

After I updated wp, function get_the_terms() is not working. When I run get_the_terms() I'm not getting terms, but when I put before that call "wp_cache_flush();", I'm getting terms so there is ...
0
votes
1answer
52 views

get_term_by works but get_terms doesn't?

I currently have a Multisite with 2 sites. From the secondary site get_term_by() works to retrieve terms from the primary site, but get_terms() does not. I'm using switch_to_blog(1); but I get ...
0
votes
2answers
38 views

How to display taxonomy terms the way they are hierarchical

Reading Kaiser's query and Scribu's answer I'm now in an ocean of no shore. I made a custom taxonomy, where I want to show the terms as per their hierarchy, like below: Level 0 -- Level 1 --- Level 2 ...
0
votes
1answer
27 views

Group child category IDs based on their parent category

I have IDs for my child categories, 11,14,21,35,38,39, where these all are various child categories from their main category: Parent category 1 has: 11,14 Parent category 2 has: 21 Parent category 3 ...
0
votes
0answers
50 views

Get those terms with a specific meta key value

I'm having a custom taxonomy for addresses. And I've created a true/false button through acf plugin to tell an address that it's the standard address. How can I get only the one term that has ...
0
votes
1answer
37 views

Get count for all terms inside a parent term

I am trying to get the post count for a term and it's child terms. I tried it with pad_count=> true but this seems to have no effect. My term stucture is like the following: - term 1: 10 posts - ...
1
vote
1answer
45 views

get_terms orderby numeric

I am trying to order my terms numeric. But the problem is that nog every term is numeric. So I have the following terms (check image below) which some of them are dimensions and some are others. As ...
1
vote
0answers
58 views

Fetch and ACF image field from a custom taxonomy outside category/archive page?

I have a project where we have registered a custom taxonomy called "product-category" and have an Advanced Custom Field linked to it called "range_image". We then have a custom page template (not a ...
0
votes
0answers
15 views

Getting Post Tags From Certain Categories

The site I am working on has about 4 different post categories. I need to output a list (unordered) of tags in that category so that a user can click on them and see posts in THAT category tagged with ...
0
votes
1answer
52 views

get_terms not working when child_of is used

I have a custom taxonomy registered as department, which works in other queries but it doesn't work when I use: $args = array( 'child_of' => 483 , 'hide_empty' => false); $subcats = get_terms( ...
0
votes
0answers
65 views

get_terms functions.php

my functions.php function retrieve_my_terms() { $get_participants_country1 = get_terms('participants_country', array( 'hide_empty' => false ) ); $teras_terms = array(); foreach( ...
0
votes
0answers
23 views

Show only Taxonomy Titles that have been selected in the Custom Post Type

I have the following code $post_type = 'dealer'; $tax = 'regions'; $tax_args = array( 'order' => 'DESC', 'parent' => 0, 'hide_empty' => 1, ); // get all the first level terms ...
0
votes
1answer
31 views

Get all terms/slugs - used, not used & in hierarchical order

I need to get all the slugs/terms - those that are used & those that are not. It's hierarchical (3-4 levels). How to get all (used & not used) terms/slugs in hierarchical order? This code ...
0
votes
1answer
44 views

Hide Custom Taxonomy title if not associated with another Custom Taxomony

Custom Post type named Business (Custom Fields (Contact Details, Business Name)) Taxonomy for Type of Business (What they do (Cleaning, Auto)) Taxonomy for Location of Business; example Melbourne --> ...
0
votes
1answer
62 views

Display List of Categories Within a Custom Taxonomy

My website is an online magazine, so I have a custom function that creates a taxonomy (Volume/Issue) for Posts and Pages. Each issue of the magazine has its own particular category (e.g. News, ...
0
votes
0answers
9 views

What is the earliest hook you can piggyback on to check terms/taxonomy for a collection view?

I am attempting to set up some conditional logic based on whether or not get_the_terms( $post->ID, 'product_cat' ) has the term 'Photographs' in it. Currently I'm using the wp hook, but that ...
1
vote
2answers
142 views

How to output wordpress custom tags separated by comma?

Based on a few references I've built a function to output a list of custom taxonomy terms separated by comma. The code works as intended, where food_tag is the custom taxonomy I registered for a ...
0
votes
1answer
441 views

Woocommerce get category image full size

i'm trying to get the full size image of my category products. $prod_categories = get_terms( 'product_cat', array( 'orderby' => 'name', 'order' => 'ASC', ...
0
votes
0answers
27 views

Get Meta Values and Count based on Meta Keys

Is there a function or a script to get the distinct meta values given a meta key and post type? I was hoping for a function similar to get_terms() for taxonomy. In addition to each meta value, there ...
0
votes
1answer
37 views

Returning One custom taxonomy term name

I have a custom taxonomy called cities and right now the only city is las vegas. I am trying to use the code in question to echo "Las Vegas" - for the posts that are associated - on the search results ...
0
votes
1answer
259 views

Get custom category image from menu

I've got myself into a little pickle, and while I'm so close, my understanding of PHP is letting me down. I want to display the image associated with each category in the menu - working from the ...
0
votes
1answer
148 views

Empty tax_query array returns an empty array

I would like to return all posts when the tax_query['terms'] is empty. $args = array( 'post_type' => 'product', 'posts_per_page' => 15, 'paged' => $paged, ...
0
votes
0answers
73 views

add_action priority and taxonomy used in plugin

I try to register my taxonomy in my plugin and use it after. So far I have done: function custom_taxonomy() { $labels = array( ... ); $args = array( ... ); ...
1
vote
2answers
123 views

Display latest x posts from all categories in Custom Post Type/Taxonomy

I am attempting to display the latest x posts from all categories using a custom taxonomy called 'case-studies' in WordPress. I have managed to output all the category names as heading links I have ...
0
votes
1answer
33 views

Getting Category Children

i have a problem understanding the get_terms function All i want is getting all the children of specific category so that it can be listed. But i don't really know how the $args works. So with this ...
-1
votes
1answer
1k views

Display woocommerce product_cat child terms with thumbnails

I was wondering if someone could give me a hand. I would like to display the child categories of my woo commerce store categories along with the thumbnails I have set for them in my dashboard. I have ...
0
votes
0answers
100 views

Dropdown Settings API for get_terms Menu option

I am using get_terms to display a list of available menus and then display those menus for a plugin settings selection - that part works fine - but I can't retrieve and display the value. I am not ...
0
votes
1answer
103 views

Get all categories post is not in

I am trying to get a list of all categories that the current post is not in. I made it this far... $categories = get_the_category( $post_id ); $nocats = get_terms('category', array('exclude' => ...
0
votes
0answers
22 views

Create a list of Taxonomy 1 terms for Post type in Taxonomy 2

I am trying to create a Select List of Taxonomy terms which are used in by a Post type in a different Taxonomy. I can't get my head around on how to do it. My post type is Game. Taxonomy 1 is Cities. ...
3
votes
2answers
2k views

Display Category Thumbnail and links in Woo commerce

I would like to display my categories with a thumbnail in woocommerce. I am able to list the child terms as a link but i would like to add additional content. I have added the code below in which I ...
0
votes
0answers
182 views

show/display/print list of sub-categories (of a specific parent category) assigned to products that have a specific other category

I have to find the products assigned to a specific category and after,just about those products, show the list of sub-categories of a specific parent-category here's a example scheme: product 1 - ...
0
votes
1answer
68 views

Get_terms stopped working after WP 4.2

I just noticed on my site that the custom taxonomy terms are no longer out putting. I am only guessing that it's happened since the 4.2 update. Here is the php: $terms = get_the_terms( $post->ID ...
0
votes
1answer
88 views

Get the selected term in a dropdown search

I am using the following function to create a dropdown search form and populate it with the terms of a custom taxonomy called 'grades'. The dropdown works for searching, but I can't figure out how to ...
0
votes
1answer
126 views

Add “selected” class to custom taxonomy dropdown search

I found the following function to add a custom taxonomy dropdown to a search form. It works fine for searching, but it does not add the "selected" class to the searched-for term. Here is my code for ...
0
votes
0answers
23 views

How to order terms by parent term

I want to order the terms by parent. Parent term 1 -- Child term 2 -- Child term 3 -- Child term 4 Parent term 5 -- Child term 6 -- Child term 7 -- Child term 8 -- Child term 9 -- Child term ...
0
votes
4answers
440 views

get_terms custom order

I am using the get_terms function to order all the terms of a custom taxonomy alphabetically. My client however has now requested that one of the terms be put at the very end (therefore not in ...
0
votes
1answer
92 views

get_term_link() returns correct - But illogical error-messages disturb

I've a really strange issue with Wordpress and the get_the_link()-function and a following issue with objects who are objects, but identified as non-object-error, itself they are working. First the ...
0
votes
1answer
20 views

Display empty custom taxonomies differently than with one with posts

I'm trying to display all of my custom taxonomies using get_terms. This part is fine. But I'd like to display the taxonomies that have zero posts attached to them slightly differently. Here's what I ...
0
votes
0answers
33 views

How to create a collection of terms used by posts from wp_query

I am creating a custom search results page that has a WP_Query that looks like this: $args = array( 'post_type' => 'manuals', 'posts_per_page' => -1, 's' => ...
1
vote
1answer
66 views

conditional statement based on terms

I was wondering if someone could help me out. I have created a custom query to retrieve in a custom single.php to retrieve posts which have the same custom taxonomy term and display them. here is the ...
-1
votes
1answer
345 views

How can I get parent term from a child term

I have a custom post type and a taxonomy, when adding a post if I select a child term and not the parent term then I cannot use get terms as the parent term wont be in the array as it wasn't selected ...
0
votes
1answer
25 views

CTP - check for value inside objects

I have registered a CTP which can add a new plant and user can tick which months it can be planted (february, march and april for example). Now, I need to display it on the page but with all months ...
1
vote
2answers
924 views

Get direct children of custom taxonomy

I've googled extensively and tried my best, but I just can't get the first level children of the custom taxonomy in the code below to work! It only displays the parent level. What I am trying to ...
2
votes
1answer
451 views

get_terms name__like list categories according to letter

My categories are basically authors, and I would like to create a function to list them according to their surname. For example I'd like to have something like: E: Heinz Erhardt Albert Einstein ...