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
9 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
52 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
10 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
21 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
17 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
47 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
41 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
27 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
38 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
29 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
37 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
13 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
65 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
51 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
94 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
48 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
39 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
49 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
38 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
84 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
39 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
27 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
105 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
19 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
48 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
84 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
47 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 ...
0
votes
0answers
29 views

How to map ids of taxonomy with custom post type objects?

My wordpress installation contains of $locations (which are actually categorycourses which is a a taxonomy). foreach($locations as $location) { $categorycourses_ids_array = ...
0
votes
1answer
127 views

get_term and get_term_by returning null or false eventhough the term exists

I am trying to use the action hook delete_term, 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 favorite ...
0
votes
0answers
126 views

term meta query

I add custom fields to attributes like "paint". The attribute will have paint as name and colorcode as meta term field. Before get_terms, terms_clauses left join the woocommerce term meta to get ...
0
votes
2answers
567 views

Show all wp_get_post_terms slugs

I am using the following code to display my custom taxonomy slugs. However it is only displaying the first category and not all the related categories. I know this is fairly simple and is to do with ...
-1
votes
1answer
24 views

How to display a term of taxonomy

My doubt is how can I show a "term” of an specific taxonomy, the problem is that I have not found an applying example, just short code lines that don’t show me nothing at all. I want please the ...
0
votes
0answers
43 views

Get taxonomies inbetween WP_Query?

Basically I have two loops that work seperately but I need information of one of the loops to go into a listing which happens to be in the other loop. This concerns fetching custom taxonomies and ...
0
votes
1answer
106 views

Show all terms of a custom taxonomy?

I made a few custom taxonomies and I need to show ALL the terms from it, what I achieved so far is showing the taxonomies that are selected/chosen in a custom post type but I need all of them to show, ...
0
votes
1answer
37 views

Show all videos by tag name

I need to get all videos by tag name, im using code like that $tax_terms = get_terms('media_category', 'orderby=count&order=DESC&hide_empty=0'); foreach ( $tax_terms as $tax_term ) { ...
0
votes
0answers
76 views

How to use if statements to check and echo terms by hierarchy in a post?

I'm seeing a lot of posts on here with helpful snippets to resolve my problem, but nothing has been specific enough to help me - or I just don't understand how to make those solutions work for my ...
0
votes
0answers
38 views

Get current terms info when querying by multiple taxonomy terms

I'm currently using the following in my archive template to create a menu of taxonomy terms and add a 'live' class to the term that's currently being queried. $termsA = get_terms('MYTaxA', array( ...
0
votes
1answer
130 views

Add current class to queried term on taxonomy term archive

I'm currently using get_terms to list terms of a certain taxonomy. I would like to add a class to the term currently being queried via the archive template. I tried putting together the below code ...
0
votes
0answers
10 views

output button depending the taxonomy

I'm trying to display two different buttons depending on the taxonomy the post is related to. I have a custom post type called "project". I have a taxonomy called "villes" (cities). For example if ...
0
votes
0answers
78 views

get_terms returns the keys, but I can't get the values in all languages, Using qTranslate

I am using this code to generate some <select> that I display in the sidebar to filter posts depending on the term values (of each select) <div class='filterbox-content'> <?php ...
0
votes
0answers
111 views

Using get_terms() as shortcode attribute

Hop you pepople would be fine. I'm creating a shortcode with the following code. $categories = get_terms( 'project-type' ); foreach ($categories as $category) { ...
0
votes
2answers
60 views

Get term_id for each instance of custom taxonomy

I am building a custom image slider. I have a custom post type called 'slide' with an associated custom taxonomy called 'slideshows'. When you create a new 'slideshow' it add to a custom table in ...
0
votes
0answers
155 views

Get only last child category link of products

At the moment i have this code: $collections = get_the_terms( $post->ID, 'product_cat' ); foreach( $collections as $collection ) { $link = get_bloginfo( 'url' ) . '/' . $collection->slug . ...
0
votes
1answer
68 views

How do I get taxonomy terms by ID in a specific order

How do I get taxonomy terms by ID in a specific order. Below is my code and I thought if I passed get_terms the arguments to with ID and post_in but I am not seeing the results I thought I should. ...
0
votes
1answer
219 views

Taxonomy term breadcrumb; how?

Given a taxonomy term (perhaps in a taxonomy*.php template) how to construct a breadcrumb going up the full ancestry of the term? Is there any shorter way other than a "brute-force" loop to query ...
0
votes
1answer
537 views

get_term_children for immediate children only (not grandchildren)

I want to display term children of a custom taxonomy. Currently, I am able to do this using get_term_children, but using this, it displays children and grandchildren, I want to avoid this and make ...
0
votes
0answers
53 views

Why did this wp_query stop working in 3.7?

The wp_query below stopped working upon an upgrade to 3.7. I rolled the site back to 3.6.2 and it's working fine. Anyone aware which code here might have changed? There's a lot going on, but briefly, ...
0
votes
2answers
185 views

Term begins with a letter

I had a template that relied on $terms = get_terms( "ingredient", array( 'name__like' => $letter ) ); to return all posts where the custom taxonomy ingredient begins with $letter. The behaviour ...
0
votes
2answers
51 views

Get Parent Custom Taxonomy Term and Color Div background

I am currently displaying posts from a CPT. Each has a taxonomy term from a parent. I would like to create a function that would color the background of a div of particular parent terms. Here is my ...