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
31 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
26 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
14 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 ...
0
votes
1answer
40 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
12 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
24 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
18 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
44 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
16 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
45 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
59 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
79 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
25 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 ...
1
vote
1answer
54 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
19 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
22 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
132 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
52 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
61 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
16 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
74 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
43 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
2answers
181 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
21 views

Custom taxonomy no data

Ladies and Gentleman, i have a problem. I habe created a taxonomy like this in my functions.php function drivers_init() { // create a new taxonomy register_taxonomy( 'tax_drivers', ...
0
votes
2answers
286 views

get_terms() doesn't return empty terms even though hide_empty is false

I can't manage to make get_terms() to return the empty terms and I've tried it in a number of ways. Here's the code: $terms = get_terms('device',array('hide_empty' => 0)); foreach($terms as ...
0
votes
0answers
38 views

Get Tags get_terms() - by user->ID ?

Is it possible to get tags for a specific user ID, i mean i want to get the tags list on author page where i want list the tags the author used to make his/her posts only - not want to get the full ...
0
votes
1answer
144 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 ...
2
votes
1answer
52 views

Does WordPress Offer a Way to Find All of the Categories that Don't Have Children?

Background As discussed in Is There a Difference Between Taxonomies and Categories, taxonomies refer to a generalized system of classification and organization of objects or data. In the case of ...
0
votes
0answers
63 views

get_terms vs wp_query for pages - results inconsistent

I have a situation where a custom post type, with a related custom taxonomy. There are somewhere in the realm of 100 of these posts. The taxonomy associated to it has about 20 terms associated with ...
0
votes
0answers
11 views

foreach loop pagination for taxonomy blog category [duplicate]

I have a wordpress website running in which I have a blogs page where I display all the blogcategories using the following code <?php $taxonomy = 'blogcategory'; ...
0
votes
1answer
293 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
58 views

Separator for multiple terms

I'm trying to show terms of custom taxonomies. I have that. But, my problem is how to separate when I have multiple terms. My code: <ul class="slides"> <?php $loop = new WP_Query( array( ...
0
votes
1answer
88 views

Exporting Custom Taxonomy in plugin

I am writing a plugin which requires exporting custom taxonomies in csv on submit button click. I am using get_terms() to export taxonomies terms. I have written a class file which handle this ...
0
votes
1answer
23 views

Get Custom Post Child Term

I am trying to echo the custom post's child "section", if one exists. I only want to show the second level, or child, sections. This is working, however, it displays the 1st level section if no second ...
0
votes
1answer
180 views

Getting Term_id - Taxonomy Metadata plugin

I've been looking everywhere but can't find any way to make this works. I am using the Taxonomy Metadata plugin and I am trying to display the custom metadata created. For this I use: ...
0
votes
0answers
62 views

How to filter the terms to a special custom taxonomy?

I do have a custom taxonomy called "countries". With the code below I get for each term (country) the number of its published posts in brackets, like the following: Canada (3) USA (5) Italy (2) ...
0
votes
2answers
166 views

Difference between get_category, get_term_by and get_categories

get_category is returning null but using get term_by or get_categories() is not. Why? I have created term called categorycourses. I have a post related to coursecategory Lidköping (vardump1), ...
0
votes
1answer
49 views

Displaying Custom Taxonomy without a hyperlink

I would love some help on how I can best display the custom taxonomy of a post as text only (and not as link within an tag). I have a small template file that is called by a few other pages, and the ...
0
votes
1answer
50 views

Displays a string of linked images

How do I displays a string of linked images for a post using php? Terms http://domain.com/106.jpg,http://domain.com/109.jpg,http://domain.com/112.jpg <div class="gallery" ><?php ...
0
votes
1answer
67 views

get_terms Parent Tags

I'm using a function that I think it uses this code to get the tags from a taxonomy: if($taxonomy){ $tags = get_terms( $taxonomy, 'order=ASC&hide_empty='.$show_empty.''); As it is, is extracts ...
1
vote
1answer
39 views

Get terms from posts submitted within a certain time

I am running a query which pulls out the most popular taxonomy terms (named "cause") from a custom post type (named "reasons") and I am ordering them by most popular. However, I need to limit the ...
0
votes
2answers
242 views

List posts by their custom taxonomy term, with a condition

I have two custom taxonomies called "custom-category" and "file_type". I am using the below code to list all the terms of "file_type" along with their associated posts. Like so: File_Type Term 1 ...
0
votes
1answer
47 views

List Taxonomy terms along with their posts

I am trying to make a list of all my posts in a custom post type by the taxonomy term e.g. Term name 1 - post 1 - post 2 - post 3 Term name 2 - post 1 - post 2 - post 3 Term name 3 - post 1 ...
0
votes
1answer
37 views

GET Taxonomy ID

I have this line where "5" is the taxonomy ID. <?php echo function xyz (5,'product_cat'); ?> How can I change this to make it auto recognize always the taxonomy ID of the current page? Tried ...
0
votes
1answer
190 views

get_the_terms return only last term

In my custom post type (portfolio_pt) I have some hierarchical category structure something like that: ParentCat |-child |-someItem ParentCat2 |-cild ... When I try to get list of all terms by ...
0
votes
1answer
26 views

store an array of all the terms existing

How can I store an array of all the terms existing? (for admin use) $taxonomy = 'MYTAXONOMY'; $tax_terms = get_terms($taxonomy); foreach ($tax_terms as $tax_term) { echo ...
0
votes
1answer
60 views

Smarter navigation plugin and custom taxonomies

I am trying to make work Smarter Navigation's get_referrer_category() with a custom taxonomy that I have created. The custom taxonomy I've included into functions.php is the following: add_action( ...
2
votes
1answer
101 views

Restrict filter to run only inside specific function

I would like to filter get_terms(), but I only want to filter get_terms() when it is called from the wp_terms_checklist() function. I am looking to add a "No term" option to the end of my checklist ...
0
votes
1answer
64 views

Order terms by count - missing terms

I have this problem: I'm using get_terms with ordering by count. And some terms are missing - I have no idea why, there is no exlude, or hide posts or anything like this. What is wrong? Here is the ...