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
2answers
717 views

Attempting to filter posts using get_terms

Using get_terms I've created three lists of term links. What currently happens if I click on a term is to see the archive for that term, what I'm attempting to achieve now is when I click a second ...
1
vote
6answers
3k views

Order get_terms using a Custom Field

I have a custom taxonomy of "crb_issues" that has a custom field associated with it that is "issue_date" which outputs a date value for each term to looks a lot like "20140601" yearmonthday. I am ...
0
votes
0answers
5 views

Ordering get_terms with ACF not displaying all terms

I'm making a shortcode to return all the terms in this taxonomy. The terms are sorted with krsort by the custom field 'height' made from ACF. I'm following this answer from here. The problem is it's ...
1
vote
1answer
39 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
2answers
489 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 ...
1
vote
1answer
3k views

get_terms - only top level

I am trying to get only top level term: $cat_args = array( 'parent ' => 0, 'number' => 10, 'hide_empty' => false, ); $categories = get_terms( ...
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
1answer
792 views

Issue on Listing Sub Product Categories In Woocommerce

Using Following code I am able to list all top level Categories on Woocommerce Product Categories $args = array( 'number' => $number, 'orderby' => 'title', 'order' => ...
4
votes
7answers
21k views

Get the the top-level parent of a custom taxonomy term

How would I get the top-level parent of a given term? I am using wp_get_object_terms to get taxonomy terms on posts, but instead of showing all tagged terms, I only want to show tagged terms' ...
0
votes
2answers
922 views

How to make a metabox that contains link categories?

I'm looking for some suggestions or tutorial links about how to create a meta box that allows users to choose from a list of link categories. So far I've been looking at this post about taxonomies in ...
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 ...
0
votes
0answers
55 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 ...
0
votes
1answer
860 views

get_term and get_term_by return null or false, even though term exists

I am trying to use the action hooks delete_term and delete_$taxonomy, among other hooks that delete a term, but they are presenting the same issue. For example, 1234 is an existing term in the ...
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
25 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
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 ...
3
votes
2answers
11k 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 ...
0
votes
1answer
760 views

Listing child terms of parent term

I'm using the following code to generate a list of only the child terms within my taxonomy. What I'd also like to do is display a list of the child terms for each parent category on a ...
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 ...
1
vote
2answers
594 views

Show only the grandchildren (using get_terms)

I'm working with a hierarchical taxonomy (named "world") that has 3 levels to it (Regions > Countries > Indigenous Peoples). At the moment I'm using a modified version of this code to paginate ...
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
51 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
38 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
59 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
2answers
1k views

List all taxonomy terms / Show links if posts are attached, else names

I'm looking for a way to list all the terms from a custom taxonomy. Only the terms that have posts attached to it should have links to the archive page. If there are no posts attached it should only ...
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
67 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( ...
2
votes
3answers
2k views

Using get_terms for custom taxonomy in functions.php

I`m trying to retrieve the names of taxonomy items and include them into a theme admin panel. function retrieve_my_terms() { global $terms; $terms = get_terms('taxonomy'); foreach ...
0
votes
0answers
25 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
45 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
144 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
474 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 ...
2
votes
2answers
20k 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 ...
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
266 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 ...
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
3answers
2k views

Get only the first term by taxonomy

Maybe it's a stupid question but I can't find the answer. I have a custom taxonomy (directores) and each director is a term. Some times a film has more than one director. I need to print only the ...
0
votes
1answer
154 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
124 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 ...