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
15 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
23 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
10 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
30 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
42 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
63 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
45 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
30 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
37 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
37 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
58 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
36 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
24 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
68 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
16 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
39 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
77 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
38 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
25 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
98 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
87 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
339 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
22 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
41 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
79 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
33 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
70 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
33 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
98 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
64 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
93 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
56 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
121 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
59 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
162 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
409 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
161 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
44 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 ...
0
votes
0answers
76 views

Taxonomy archive link from term id

I'm using advanced custom fields taxonomy field to select a particular term of a custom taxonomy. I can generate the term ID based on the field but I can't display the link or the name of the term. ...
0
votes
1answer
710 views

List only first-level children of specific custom taxonomy term

I have a site set up with the following: Post Type: product Taxonomy: product_cat Taxonomy Slug: hydro The term hydro has several immediate child terms and several grandchild terms. I need to ...
0
votes
2answers
1k views

Get value in custom field with taxonomy

I have custom field my_cf for Taxonomy/Term. How can I get and output value with custom field for taxonomy/term? I've tried using: $variable = get_field('my_cf', 'basic'); echo $variable; ...
1
vote
1answer
103 views

PHP Code to Display Term URL & Name of a Post Under a Custom Post Type

I am featuring a post in my footer(outside the loop) from a custom post type and am using Advanced Custom Fields plugin to do so. This is the code I am using: <h5>Featured Movie</h5> ...
0
votes
1answer
257 views

get_terms function not returning anything

This has had me baffled for days so any help would be appreciated. I cannot get the function get_terms to return anything. I've tried the following code in the index.php, single.php and page.php, ...
1
vote
2answers
251 views

get_terms that have custom sticky field checked

I was able to add a extra custom field, named sticky, to a custom taxonomy, using the wp taxonomy meta plugin, like this: function YOUR_PREFIX_register_taxonomy_meta_boxes() { // Make sure ...
0
votes
3answers
116 views

List a custom taxonomy's terms, with links, on the taxonomy page

I have registered a custom post type in my functions.php file for "Wines", with this code: function customposttype_wines() { $labels = array( 'name' => 'Wines', ...
0
votes
0answers
287 views

How to get variation by order id on WooCommerce?

I am trying to get variation from wp_woocommerce_order_itemmeta by order id. My products have detail terms but I can't find them. It looks like this on wp_woocommerce_order_itemmeta: 431 52 ...
0
votes
2answers
227 views

Help alphabetically sorting $terms from get terms('wpsc_product_category'

I'm trying to get a list of wpsc_product_category terms, for a given category, and have them display in alphabetical order (by name) with links to their pages. This gives me the right list, but the ...
0
votes
0answers
28 views

Trying to pull tag on image attachment for a containers class

So here is my query: <?php $page = (!empty($_GET['myp'])) ? $_GET['myp'] : 1; $per_page = 20; $base = get_queried_object(); // ...