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
2answers
391 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
2answers
297 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
528 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 ...
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 ...
0
votes
2answers
297 views

Get terms in hierarchical taxonomy which are associated with page and are children of a parent term

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 ...
0
votes
2answers
541 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
159 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
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> ...
1
vote
1answer
202 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
27 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
82 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
151 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
98 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
150 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
592 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
393 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
1answer
159 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
445 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
155 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
50 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
327 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
10 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
36 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
25 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
51 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
45 views

Get Terms (Woocommerce Cats) in the order which is set in the Backend

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
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
33 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
58 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
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
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
0answers
63 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
245 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
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
0answers
170 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
620 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
0answers
93 views

Display custom taxonomy term name and slug

How can I display the custom taxonomy term name and slug? Iam using the Advanced Custom Fields plugin. See the current code: <?php $category = get_queried_object(); ...
0
votes
0answers
93 views

WP Network - List Posts child_of plus include specific category

Alright, so problem I have is my client has 8 WP sites in a network. 1 specific site they want additional posts from another category to display other then child posts of thew News category. I have ...
0
votes
0answers
14 views

organizing taxonomies in custom post type

I created a custom post type named "Gallery" which contains photos in several taxonomies e.g: Sport, Nature, Food, Drink. I want to organize all those taxonomies in my page "Gallery". So I can see ...
0
votes
0answers
98 views

get_terms not working in a plugin

I am using the following in a page template.... <?php $custom_terms = get_terms('my_custom_term'); print_r($custom_terms); foreach($custom_terms as $custom_term) { echo ...
0
votes
0answers
60 views

Taxonomy page to display top level category as field

i thought I had my issue fixed but I found out that it isn't. I have code in the sidebar of my archive template that only displays the parent taxonomy terms as links to take you to the taxonomy ...
0
votes
0answers
134 views

How to exclude child terms from tax query foreach loop

I have this query which is working fine but I can not get it to exclude child terms and include only parent terms. This is what I have so far -- <?php $custom_terms = get_terms('videoscategory'); ...
0
votes
0answers
278 views

Dynamic Dropdown populated with Categories from current page?

I have a page where it lists the category name with it's posts under. On this page it only lists the posts that are also in another custom taxonomy. To do so I am using this code which works fine -- ...
-1
votes
0answers
33 views

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

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: ...