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
1answer
77 views

Using get_terms() with meta_query parameters

Im trying to build a taxonomy query to only display the terms that have a certain custom field value assigned to it. The custom field holds a boolean value, so I tried: $args = array( '...
0
votes
1answer
16 views

Get the link of the first post of a custom taxonomy in a custom taxonomy list

Currently, I'm doing this using a custom field, but I would love for this to be automatic. Basically, I have a page that will list all the entries of a custom taxonomy, but I want the links of the ...
0
votes
0answers
25 views

If on parent term display child terms but on child terms display parent and siblings

I've been searching everywhere including the get_terms codex for a solution, but can't seem to get it right. I have a hierarchical taxonomy called "themes" with parent terms (e.g. "Acquisition of ...
1
vote
1answer
29 views

List child terms if parent but show nothing on children

I have a taxonomy called region with a hierarchical structure; • Southern Africa   • Botswana   • South Africa   • Zambia   • Zimbabwe In my taxonomy-...
0
votes
1answer
32 views

How can I pull the slug of a custom taxonomy and output it in a class?

This is the file I'm working with: <?php $class =''; foreach ($consoles as $console) { $class .= $console->slug . ' '; } ?> <div id="<?php the_id(); ?>" class="<?php echo $...
0
votes
1answer
24 views

Limit Taxonomy Output in Conditional Statement

I am trying to limit the amount of category tags I output to 5 as well as append a "..." to the end of any items where the output was limited. I've got it mostly working except I can't figure out how ...
0
votes
1answer
24 views

Get all terms linked to a post and include those who not connected from get_terms and sort

I have the following terms in my WordPress project and my post may have connected with some of them or sometimes all terms. A B C D E F My first post (example1) is connected with terms A, B and C ...
0
votes
1answer
53 views

Can you hide empty terms using get_term_children?

I'm trying to get_term_children of a specific term: $style_categories = get_term_children( 29, 'product_cat' ); if ( $style_categories ) : foreach ( $style_categories as $style ) : $...
0
votes
1answer
30 views

Wordpress get all post with like in terms [duplicate]

I have a wordpress site, which has post and custom taxonomy. I want all post of a particular taxonomy with like query. For example: Table: wp_post post_id 100 Table: term_relationship post_id ...
3
votes
1answer
51 views

Order terms inside a select dropdown

I'm working on a project where I've a dropdown of all the terms inside a taxonomy. If the user selects a term, then a function is executed. Eveything is working great, but I can't get that dropdown ...
0
votes
0answers
16 views

Display posts in a custom taxonomy, grouped by a different taxonomy

The setup: I have a custom post type called products. I have a custom taxonomy called styles with terms modern, classic, rustic. I have another taxonomy called seasons with terms fall, winter, ...
0
votes
1answer
33 views

Wordpress using get_term to retreive slug not working as expected

Im using the below code to try and get the slug for the current category and the parent category. Ive managed to get as far as getting the currently cat slug but the parent displays in readable text ...
1
vote
1answer
41 views

How to get post's current parent term ID?

How do you get the ID of the parent term of the current child term assigned to a post. For a custom taxonomy? Custom taxonomy: "location" Countries Japan USA Mexico Cities New York Austin ...
3
votes
1answer
83 views

get_terms showing link to category even if all posts are drafts

i have this code below to show links for my custom taxonomy on my custom posts. I want it to show only the categories that have published posts in them. This mostly works but if i put all the posts ...
0
votes
0answers
20 views

make wp_get_terms show active links for custom post categories

I'm trying to figure out how to make a custom post category page (for a custom post) I want to have all the categories for the posts at the top of the page as links. I've used this code below to do ...
0
votes
1answer
62 views

Orderby taxonomy term id using get_posts not working

I'm looping through a series of custom post types and then grouping those by a taxonomy term. That is working great, however I have not been able to order these groupings by term_id. I used a ...
0
votes
1answer
20 views

Wrap custom terms loop

I have a custom terms loop, that gets category images and links. <?php foreach (get_terms( 'razotajs', 'orderby=count&order=DESC&hide_empty=0&parent=0' ) as $cat) : ?> <a ...
0
votes
0answers
49 views

wp_get_post_terms returns empty array

So I have a Post term called JobNumbers, which holds jobnumbers per page. I then enter into the DB a count per page/jobnumber. This has historically been working, but something happened and now it's ...
0
votes
0answers
45 views

How to get the terms list of current post's child taxonomy

This is my custom post type structure: Product (custom post type) productcategory (custom taxonomy) producttag (custom taxonomy) I want to get the terms list(all producttag) of current post's ...
0
votes
1answer
29 views

Get terms parent ID for conditional IF statement

I have the following working code to echo the name of the term (taxonomy called prodcats) that a series of posts are in. This is in the taxonomy archive template taxonomy-prodcats.php $terms = ...
0
votes
0answers
22 views

Fetching get_terms data of a custom [empty - no posts assigned] taxonomy its in archive page?

My problem: when I access an archive page of a custom taxonomy's subcat. or subsubcat. and the cat. has no posts assigned to it, WP get_terms() functions returns nothing. When a cat. has > 0 posts ...
0
votes
1answer
176 views

Add arguments to get_the_terms for custom post types

When using get_the_terms to retrieve terms within a taxonomy for a custom post type you can't pass arguments, like so: function custom_cat_function() { global $post; $args = array( '...
3
votes
2answers
84 views

Child terms from multiple parents?

I'm using isotope to filter a custom post type. But I only want the child taxonomies of 2 particular parents. I have it working nicely for one parent, but I'm not sure how to modify the array to ...
0
votes
0answers
29 views

How do I output “Parent Term / Child Term” of a taxonomy for a custom post?

Inside a custom post (a glossary term), I want to output its subjects (in taxonomy 'glossary_subject'). Some subjects have parent terms. I would like my output to look like this: Parent Term1 - Child ...
0
votes
0answers
44 views

Get wp_taxonomy_term inside WP_Query throwing an error

I am using Elastic Grid in my site. When I am coding in to the WP it is giving me an error saying K.data(...).split is not a function Here is my code, $(function(){ $("#elastic_grid_demo")....
0
votes
0answers
22 views

ordering alphanumeric terms by numeric value

I have a list of terms under a custom taxonomy which all terms in there have combined alphabetic/numeric names (sheet 38 for example, which actually includes a a space as well). I want to order them ...
1
vote
1answer
224 views

How to get category image custom post type taxonomy in wordpress?

I have a custom post estate_property and its has taxonomies property_category ,propert_action.I have installed WPCustom Category Image to upload image for each category of taxonomies. How to display ...
0
votes
1answer
121 views

Sorting get_terms, ACF is automatically removing duplicates

I read over the ACF & WordPress documentation and both do not mention why/when/how duplicate values are removed from an array when sorting taxonomy terms by custom fields. I learned that ACF does ...
0
votes
1answer
31 views

Create a a form for custom taxonomy terms

Currently i am displaying a list of my custom taxonomy (contenttags). These are displayed in a list using the code below, which then displays the posts under that taxonomy. <?php $taxonomy = '...
0
votes
2answers
36 views

taxonomy terms are not populating select tag options

I am retrieving taxonomy terms. The code is working. Foreach creates three options for the select tag. There are three terms. But, when I wanted to echo "selected" for each options, after selecting ...
0
votes
1answer
41 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
98 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, id....
0
votes
1answer
37 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?
1
vote
2answers
146 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
32 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
13 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 = array_map('...
0
votes
0answers
47 views

get_the_terms is not working

After I updated WordPress, a function using get_the_terms() is not working. When I run get_the_terms() I'm not getting terms, but when I add before that call wp_cache_flush(); I'm getting terms so ...
0
votes
1answer
205 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
54 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
64 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 ...
1
vote
0answers
422 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
107 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
102 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
1answer
142 views

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

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
19 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
144 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
119 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
33 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
41 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
73 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 --> ...