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

1
vote
3answers
453 views

get_terms orderby name as numbers

I have a custom taxonomy filled with terms such as 'volume 1', 'volume 2', 'issue 1', 'issue 2', 'issue 10' and get_terms orderby name returns list as: issue 1, issue 10, issue 2 though I need it to ...
1
vote
3answers
353 views

Show only the grandchildren (using get_terms)

I'm working with a hierarchical taxonomy (named "world") that has 3 levels to it (Regions > Countries > Indigenous Peoples). At the moment I'm using a modified version of this code to paginate ...
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; ...
0
votes
2answers
98 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 ...
0
votes
2answers
503 views

Attempting to filter posts using get_terms

Using get_terms I've created three lists of term links. What currently happens if I click on a term is to see the archive for that term, what I'm attempting to achieve now is when I click a second ...
0
votes
2answers
342 views

Get terms in hierarchical taxonomy

I have a hierarchical custom taxonomy ("photos"), with 3 parent terms color location year Each parent term has several children terms. I have associated the "photos" taxonomy with pages and have ...
0
votes
2answers
635 views

How to make a metabox that contains link categories?

I'm looking for some suggestions or tutorial links about how to create a meta box that allows users to choose from a list of link categories. So far I've been looking at this post about taxonomies in ...
0
votes
2answers
164 views

Echo used hierarchical taxonomies parent name

I want to echo my hierarchical taxonomies parents which I used in my posts. I've see answers about that, but no one didn't help me. To get all taxonomies, currently I use <?php the_terms( ...
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 ...
1
vote
1answer
110 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> ...
1
vote
1answer
224 views

How to remove plugin-specific custom taxonomy terms when plugin is uninstalled?

I'm trying to write a class that would allow for easy removal of all plugin-related data when the plugin is uninstalled. Specifically, I want it to remove plugin options, custom post type entries, and ...
0
votes
1answer
25 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
11 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
35 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
111 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
1answer
126 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
217 views

How to add a post counter to the list of custom taxonomy terms?

I am using the below code to display the list (radio buttons) of terms that are currently used by existing custom post type posts: $args = array( 'taxonomy' => 'typ', 'post_type' => ...
0
votes
1answer
116 views

add_query_arg to look up page title

I'm trying to get the code below to look up the status name, i.e. new, open, pending or resolved with the word ticket together to find pages called new tickets, open tickets etc. $ticket_status = ...
0
votes
1answer
186 views

Show single Child Category on Custom Post

Am hoping someone can help me pull out a single custom category name and show it on my custom post page. I've created a new custom post type 'Itinerary' as well as some new custom categories (terms): ...
0
votes
1answer
654 views

WPML wp_query not working properly in one language

I have a wp_query for a custom post type and the custom taxonomy, the idea is top display the term name and below each term the associated posts. I have two languages Dutch & French. Query is ...
0
votes
1answer
185 views

“Trying to get property of non-object” error when using custom taxonomies

I am encountering a weird error when working with custom taxonomies. I am trying to get the name of categories of a custom taxonomy: $terms = get_terms('taxonomy_name'); foreach ($terms as $term) { ...
-1
votes
1answer
536 views

get_category_children/ the new get_term_children not work

I have a custom Walker for a Advanced Search, that outputs the categories for multiple search by categories in checkbox. The Problem here is, that i use the get_category_children for the children ...
2
votes
0answers
196 views

Display Terms for all posts in Current Archive or Query

I am using the following code to create a list of linked terms belonging to a taxonomy. <?php $taxonomy = 'taxonomy_name'; $queried_term = get_query_var($taxonomy); $terms = get_terms($taxonomy, ...
1
vote
0answers
65 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 ...
1
vote
0answers
495 views

When using the get_terms and trying to order the terms using the 'order' and/or 'orderby' does not work

does this code really get you the categories in the order you want? $categories = get_terms( 'category', 'order=ASC' ); echo "<pre>"; var_dump($categories); for me, it does not. In fact, ...
0
votes
0answers
11 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
47 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
0answers
27 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
0answers
96 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
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
0answers
72 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
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
67 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
97 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
0answers
131 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
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
0answers
80 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
0answers
291 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
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(); // ...
0
votes
0answers
188 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
0answers
195 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. ...