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

2
votes
1answer
61 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
28 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 ...
-1
votes
0answers
34 views

term_id a 13 character string, not an integer. How do I replicate this? [on hold]

I am trying to manually insert meta data to a post that requires the term ID within it. I expect it to be a number but it is in fact a 13 character string. Revising the plugin code, I see this: ...
0
votes
0answers
11 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
28 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
37 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
40 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
18 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
27 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
46 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
20 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
52 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
47 views

Get Terms (Woocommerce Cats) in the order which is set in the Backend [on hold]

I want to have a category list, which lists the product cats in teh order, they are set in the backend. This is my current code: $categories = get_terms( 'product_cat', array( 'orderby' => ...
0
votes
0answers
26 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
38 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
8 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
34 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
59 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
50 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
66 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
43 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
54 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
162 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
51 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
102 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
38 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
64 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
321 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
534 views

get value in custom field with taxonomy

i have custom field (my_cf) for Taxonomy/Term, how i can get and output value with custom field for taxonomy/term? try use: $variable = get_field('my_cf', 'basic'); and then echo $variable; where ...
1
vote
1answer
81 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
125 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
156 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
96 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
246 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
130 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
26 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(); // ...
0
votes
0answers
167 views

Add a DropDown Taxonomy Filter on Archive Page

I need to add a taxonomy dropdwon filter in archive page so that I can display the posts assigned to selected taxonomy. Here is the HTML Output for taxonomies: <form method="post" ...
0
votes
1answer
64 views

Custom Post Type archive loop separated by term, in specific term order

I have a custom post type registered (our-team) and I have a taxonomy (team-categories) with multiple terms. Each term has multiple posts assigned to it. On my custom post type archive ...
1
vote
2answers
1k views

Woocommerce get cart total price in a number format [closed]

Is it possible to get the cart total price without any markup. So without the € symbol? Right now I'm getting the amount with: $totalamount = $woocommerce->cart->get_cart_total(); this ...
0
votes
1answer
83 views

Exclude a category from the filed under list

I have a site where I have a category that I'm using for some backend functionality. However, when I'm viewing a post that is in that category and other categories, I don't want to see that category ...
0
votes
1answer
105 views

Add custom post type taxonomy tag to article class

Ok, so I have tried about 5 different WP functions now and no luck. Basically here is what I want to do. I have a custom post type called "work", I have a taxonomy within this custom post type called ...
0
votes
2answers
71 views

How to limit the number of terms (terms acts like categories)

Hello i have created taxonomy in custom post type that act like category. then i have created terms that acts like categories. i have create widget that show all terms from taxonomy. all works ...
1
vote
2answers
133 views

get_term_children returns WP_Error for custom taxonomy

What I'm working on is a ajax based dropdown option form which returns child terms based on the option selected. When the option is selected, a function is fired using onchange, where the script ...
1
vote
0answers
51 views

Custom taxonomy widget in admin area

I have a custom taxonomy set up on a custom post type and the box it uses is the same as categories, except I wanted to make it easily searchable using a filter script and then also allow the user to ...
0
votes
1answer
47 views

Get fuzzy matches from get_term_by

I would like to get a term, knowing only part of its slug. The way my slugs are set up, make it so the category name appears before a language code, and I sometimes need to get the term just from the ...
0
votes
1answer
376 views

Taxonomy query for children of parents

I am stuck on this. I thought I had it correct but then realized it's not. I have a custom hierarchical taxonomy based on location. States are top level and counties are children. I have the top level ...
0
votes
2answers
117 views

Get terms within a custom taxonomy

I need to get an array of all terms within a custom taxonomy where they have a parent term from another custom taxonomy. The example would be I have a custom taxonomy "School" where each term (in this ...
0
votes
0answers
171 views

Hide WooCommerce out of stock product attribute items

I've created an attribute for WooCommerce products: size, it has three items, size1, size2 and size3. I can use get_terms('pa_size', 'orderby=name&hide_empty=1'); to get size attribute items. ...
0
votes
0answers
621 views

Query custom taxonomy term to display child terms & posts associated with term but exclude parent term

I've created a custom page-template to pull a custom post types (education) custom taxonomy (animals). What I'm trying to do is display all child posts + term (set as h2) inside the term ...
0
votes
1answer
212 views

Echo custom taxonomy slug

I feel like I'm this close but can't figure out if it's a synax or variable thing. I'm tring to echo the slug to auto-populate the corresponding image. <?php $terms = get_the_terms( ...