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
25 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
47 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
34 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
25 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
13 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. ...
2
votes
2answers
56 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
66 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
42 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
38 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
64 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
16 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
96 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
23 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
15 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
19 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
28 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
74 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
20 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
251 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
191 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 ...
0
votes
1answer
61 views

More efficient way to list posts by category [duplicate]

I have a page that lists posts grouped by category. Here is the current code: <?php $cats = get_terms('category'); foreach ($cats as $cat) { $cat_id= $cat->term_id; echo ...
0
votes
1answer
81 views

Display Custom Taxonomy Terns ordered by meta_value

I got stuck with ordering custom taxonomy. I've created a hierarchical custom taxonomy called Brand and created some meta tags including one called position. Now I would like to display my terms ...
0
votes
3answers
90 views

Getting category URL with hyphens, not spaces

So, I am using this to get the URL: <a href="/category/<?php foreach((get_the_category()) as $category) { echo $category->cat_name . ' '; } ?>"> Which is outputting: ...
0
votes
1answer
30 views

How can I get 3 different taxonomy type terms in a div class element?

I have this situation where I need to filter specific post type posts by its taxonomies (there 3 different ones) and since I am using Isotope, I need them in my class element. I already made it work ...
0
votes
1answer
26 views

List terms and order by second word

I have the following code in my sidebar listing the terms or a custom taxonomy, these are names, first Name and last name. Is it possible to list them alphabetically by last name rather than the first ...
0
votes
1answer
112 views

Displaying a custom post types custom taxonomy value?

I've got a custom post type with multiple custom taxonomies + metaboxes. I've used multiple approaches from the codex and other on line resources but none seem to work. I basically want to display the ...
0
votes
0answers
51 views

Prevent repetitive terms in get_the_term_list

I've created a custom taxonomy 'work_category' for a custom post type 'works'. Then I added 5 new work categories and assigned them to every single 'work'. I've used get_the_term_list to print out a ...
1
vote
1answer
50 views

Display a list of certain categories by ID

I have a list of custom taxonomy IDs like (1, 2, 3, 10). I want to display a list of these specified categories by names and each should have its childs like: Europe France Germany Africa ...
0
votes
0answers
31 views

Sort get_term_children when they are inside an array

At the moment I have this code below, but it doesn't sort the children. There are some answers on this website, but they involve a known category ID, while in this case the child categories are in an ...
1
vote
1answer
110 views

Display tags belonging to a specific post type only

The following code currently indexes all tags for my site (whether attached to a standard post or a custom post) like this I want to limit this code to index tags from only a specific custom post ...
0
votes
0answers
77 views

get_terms(); show private posts when logged in

Hi have a custom post type "FAQ". I got some "FAQ's" that are private, also only visible for logged in users. I used "get_terms()" funktion for a widget that is listing links to the categories of ...
0
votes
1answer
43 views

Query pages by child term

I cannot seem to get this to work, I have tried everything I can think of and spent enough time googling, to get me to seek help elsewhere. I need to query pages in a loop, using the same taxonomy as ...
0
votes
0answers
30 views

Getting two different answers when using get_the_terms

When setting a variable $cats = get_the_terms( $current_page_id, 'category' ); Outputting $cats to the console gives me two slightly different objects depending on the post. (Usually after a while ...
0
votes
2answers
548 views

get_terms: determine if taxonomy term has children

I'm looking to determine if a taxonomy term has children. See the below markup and I'll explain what I mean: <?php $terms = get_terms("wpsc_product_category"); if ( !empty( $terms ) && ...
0
votes
0answers
9 views

Use get_term to display top-level term only [duplicate]

I can't figure out how to modify this to display only the top-level term: $e_make_model_terms = get_the_terms( get_the_ID(), 'e_make_model' ); $make_value = ''; if ( ! empty( ...
0
votes
0answers
29 views

Generate list of tags from search results

On my search results pages I have my tags list too. But I only want to show tags that will filter the results further. So clicking on a tag will filter the result with the search term AND the selected ...
0
votes
2answers
477 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 ...
-1
votes
1answer
65 views

Can One Taxonomies Terms be Ordered by A Seperate Taxonomy?

I need some advice. I have a post type called "Movies" for example. Inside Movies, I have two taxonomies: Genres and Ratings Under Ratings my terms are 5 star, 4 star, 3 star, etc. Under Genres ...
0
votes
0answers
94 views

Issue on Counting CPT's Under Taxonomy Term

I am using this code to count number of Custom Post Type $tax_terms = get_terms($tax, $args); foreach ($tax_terms as $tax_term) { echo '<li>' . '<a href="' . ...
0
votes
1answer
75 views

Get Custom Taxonomy Terms by Date

I'm trying to get a list of custom taxonomy terms by date (or possibly slug). What I need is the NEWEST term and it's permalink in a custom taxonomy. I've been trying the code below but it's returning ...
2
votes
1answer
517 views

Get parent id by term id

I have the id of a term. Which is the function to call to get the parent id of the term?
0
votes
1answer
21 views

Getting the parent terms adds additional empty markup [closed]

I am trying to get only top level terms from hierarchical taxonomy called "City". It works fine in a way, because it outputs extra elements... $cities = get_terms( 'city' , array( ...
0
votes
0answers
40 views

Get Taxonomy Link if is in another Taxonomy

I am working on a site with a custom post type and two custom taxonomies: "book" and "chapter". I want to display a list of chapters of books. The Chapter list would link to posts tagged under that ...
0
votes
1answer
507 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' => ...
-1
votes
1answer
82 views

Issue On Listing Woocommerce Parent Tag List

I am having some issue on getting top level terms of product_cat Taxonomy of WooCommerce First of all I have a code which list all Terms in product_cat as: $terms = get_terms("product_cat"); if ( ...
0
votes
1answer
135 views

Display taxonomy term slugs

I'm looking to display a slug list of the taxonomy term for the current post within the loop. <?php $terms = get_the_terms( $post->ID, 'wpsc_product_category' ); if ( !empty( $terms ) ){ $term ...
0
votes
0answers
24 views

wordpress custom url rewrite for custom post type

I have a wordpress page https://example.com/service-detail/, it shows some result. Currently if i have to filter result, a parameter is passed like this /service-detail/?services=myservice ...
0
votes
0answers
139 views

How to get Taxonomies Only assigned to Queried Post types?

I'm developing a wordpress site about real state, I have a custom post type called "Property" and a custom taxonomy(attached to property post type) "Location" (Kendall, Boca raton , Del Ray beach ...
0
votes
1answer
266 views

get_terms from registered taxonomies not working

In functions.php I can var_dump() taxonomies like: $taxonomies=get_taxonomies('','names'); echo '<pre>'; var_dump($taxonomies); which give me: array(7) { ["category"]=> string(8) ...
0
votes
3answers
1k 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 ...