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
334 views

view subcategories order by id

this code to display subcategories in categories page i need to view subcategories sort as id subcategories can anyone update this code to view subcategories order by id <?php if(is_category()) { ...
1
vote
1answer
207 views

Echo custom taxonomy term name

I would like to echo out the term name from a custom taxonomy 'recipes' but all I get is the word "recipe" when it should say eg "pizza recipe". Is name the right argument here or I am mistaking it ...
0
votes
1answer
731 views

Get only the first term by taxonomy

Maybe it's a stupid question but I can't find the answer. I have a custom taxonomy (directores) and each director is a term. Some times a film has more than one director. I need to print only the ...
1
vote
0answers
554 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
1answer
62 views

Problem retriving the post type category

I have a small isuue, this code retrive me the parent categories from a post type. The post_type is : serial The taxonomy is : seriale <?php $terms = get_terms('seriale','child_of=668');foreach ...
-1
votes
1answer
585 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 ...
1
vote
1answer
400 views

How to determine the depth of a term in a custom taxonomy?

I'm building a <select> dropdown to display a list of terms for a custom hierarchical taxonomy. How do I know the depth of each term? I'd like to add some indentation for child-terms (the more ...
2
votes
3answers
491 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
1answer
238 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
602 views

How to create drop down for child categories of current taxonomy being viewed?

I need to know how can I get the child/grandchild terms of the current taxonomy being viewed, and put it into a drop down so that I can add values to the options. I am currently using this code to ...
0
votes
1answer
523 views

Display custom taxonomy attached to the post on post single page

I need to display the first custom taxonomy attached to the post on post single page. The custom taxonomy is similar to category attached to the posts. I need to display the first custom taxonomy with ...
-1
votes
1answer
1k views

Isotope Drop Down Categories Filter Function

I have a code in my functions file that I am using to generate a list of categories so that I can use isotope to filter the current page. However I need to know how to - How to make it a drop down ...
0
votes
2answers
552 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
231 views

ISOTOPE - Missing/Invalid Arguement Get Terms

I am trying to use the isotope plugin for sorting on my taxonomy page and even though I don't know much about how to set it up, I tried using some advice found on here. Wordpress and isotope ...
-1
votes
3answers
377 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
195 views

PHP displaying wrong custom taxonomy images

I'm using the Taxonomy Images plugin to try to pull in the category images for custom categories on a page that displays all the categories my site has. For some reason, this code outputs the correct ...
1
vote
2answers
265 views

get_terms on save_post hook

Usually, if I want to check for some attribute of the post I'm about to publish, I will check like this: $post_title = $_POST['post_title']; post_title is the name of the title field in the edit ...
1
vote
3answers
1k views

Using get_terms for custom taxonomy in functions.php

I`m trying to retrieve the names of taxonomy items and include them into a theme admin panel. function retrieve_my_terms() { global $terms; $terms = get_terms('taxonomy'); foreach ...
0
votes
1answer
194 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) { ...
0
votes
1answer
551 views

Displaying custom taxonomy in the admin list of a custom post type

I'm trying to list the terms of a custom taxonomy ('genre') in the overview table in the admin area for a custom post type ('station'). To get this, I tried the following code in my theme's ...
1
vote
2answers
4k views

Advanced custom fields - taxonomy terms images [closed]

I used the Advanced Custom Fields plugin to add a custom field to my taxonomy. That custom field is an image which is associated with the term. Now I have a page where I display a list of all terms ...
1
vote
1answer
228 views

How to add contents of a custom field to a taxonomy term list?

I have a custom taxonomy term of 'artists' which is the artist's last name and a custom field of 'first_name'. To create a list all all artists with both their first name and last name I am using the ...
0
votes
2answers
63 views

Use get variable when rewritten url in wordpress

I have many pages which have a lot in common. They are supposed to display the same things but according to their own categories. The logical way to implement this would be to pass a variable through ...
1
vote
2answers
471 views

get_terms with more than x post count

Is there an argument for get_terms which I can fetch terms that only have say over 2 posts associated with it? I have a terms page which lists all my terms for 'artists', the page is huge but a lot of ...
4
votes
1answer
215 views

Return only the custom sub-term for custom post type, do not echo term-parent

I've made a custom function that retrieves the custom taxonomy term for a list of posts in a query, and echos both the name and the link. Additionally, it also excludes listing a term if I specify the ...
0
votes
2answers
470 views

get_terms() for custom taxonomy related to another taxonomy

I have this weird thing to do and I have no idea how to do it. Ok, so: I have two custom taxonomies: collections and categories (both are prefixed, but for the sake of simplicity, I'll use these ...
0
votes
2answers
673 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 ...
1
vote
2answers
275 views

How to add terms to my tax_query based off of the current post

I need the terms in my tax_query to be the ones from the current post. I am trying to this by using a variable. The value of the variable is given by using the get_terms() function. The problem is ...
0
votes
2answers
264 views

get_the_terms - but only show 4 Posts

I am using this code to load related posts with a custom taxonomy term slug: <?php global $post; $terms = get_the_terms( $post->ID , 'topics', 'string'); $do_not_duplicate[] = $post->ID; ...
0
votes
1answer
1k views

How to get the top most term (top ancestor) of a custom taxonomy child term?

I need to get the topmost term (top level ancestor) of a taxonomy term. Suppose the following term hierarchy: North America United States New York New York ...
0
votes
1answer
120 views

Unable to get the Parent Custom Taxonomy Terms

I am unable to get the Parent Taxonomy Terms here is the code i am writing $myterms = get_terms( 'iqvis_event_category', array( 'parent' => 0 ) ); echo '<pre>'; print_r($myterms); echo ...
0
votes
2answers
588 views

How can I get category ID by category name?

I have a few categories with the same name [some of them are sub-categories]. And I want to get an array of ID's for certain cattegory name. I tried this: $term = get_term_by('name', $cat_name, ...
1
vote
3answers
388 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 ...
8
votes
2answers
3k views

get_terms by custom post type

I have two custom post types 'country' and 'city' and a shared taxonomy 'flag'. If I use: <?php $flags = get_terms('flag', 'orderby=name&hide_empty=0'); I get a list of all terms in the ...
0
votes
2answers
166 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
265 views

Get posts inside Get terms problem

i have a get_terms which loads correctly. inside of it i have used get_posts. then using get posts i am trying to get each post tags (and count <= not currently inside this script) <?php ...
0
votes
1answer
292 views

term_exists returns NULL

According to the codex ( http://codex.wordpress.org/Function_Reference/term_exists ), term_exists returns some mixed results but not NULL. In my case, I'm getting NULL, what am I doing wrong? In ...
2
votes
1answer
181 views

Sort a custom post type array numerically

We've set up drop down lists to allow people to filter posts based on custom post types. In order to populate the drop down list I am using: <?php $terms = get_terms("ratios"); $count = ...
0
votes
1answer
220 views

Taxonomy order exception for specific term

I want to make an exception for my custom taxonomy order. Sometimes you need to put "Other" option as last option but when calling taxonomies with "orderby=name", sadly "Other" term is not listing as ...
3
votes
1answer
99 views

Is there any difference between post in child term and child & parent terms?

This may be really obvious, but I can't find other documentation or questions about it. Scenario I have a directory of Businesses (custom post types). Each Business has a "Type" (custom taxonomy). ...
5
votes
2answers
902 views

get_terms vs. get_categories: does it matter?

I'm fairly new to wordpress and am coming across new things each day - one was today when I happened across get_terms and noticed that it was basically the same as get_category. Any particular ...
1
vote
1answer
264 views

Exclude main blog from get_blogs_of_user

I use WordPress Multisite and in the sidebar i have a box that shows a list of blogs the logged in user is a member of. I'm looking for a way to exclude the mainblog from this list. The main blog ID ...
0
votes
1answer
273 views

Get object terms with no children?

Others have asked how to only get parent terms, but I need to get the deepest term for the post of a specific taxonomy. Is there a way I can only get terms where the number of children = 0?
0
votes
2answers
3k views

Get Current Custom Taxonomy ID by Post ID

If I know the current post id that i have in the variable $pid I use $terms = get_the_terms($pid, 'custom_category'); How do I get just the term id/term_taxonomy_id if I var_dump $terms I see what ...
2
votes
0answers
202 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, ...
0
votes
2answers
81 views

How do I print a term list but alter the link text?

I have a long list of taxonomy terms that all look like City-ST-Zip, ie: Phoenix-AZ-85043 or San-Diego-CA-92037 How do I print the list of terms so that the link URL remains intact but the link text ...
1
vote
1answer
406 views

how does get_term_by know which term to return when the same term appears twice in a hierarchical taxonomy?

This is from the codex. <?php get_term_by( $field, $value, $taxonomy, $output, $filter ) ?> Suppose I have a taxonomy system as follows; taxonomy: "healthy foods" and it's a hierarchical ...
0
votes
1answer
477 views

How to check if a term is parent to another?

I have made a product page. Wich lists all products site.com/products. At the product page there is a navigation wich lists all the terms in the taxonomy 'kategori'. The taxonomy is set to ...
0
votes
1answer
205 views

Ordering taxonomy output in this function

I found (googled) this function which performs almost exactly as I need. Creating a link text structure (breadcrumb) of terms for a CPT i.e. Parent Category -> Child Category -> Grand Child Category ...
0
votes
2answers
4k views

get_terms of post->id

I need a way to use get_terms and have it only grab the taxonomies of the current page. Example http://sitename.com/genre/hip_hop would only grab the taxonomies that also have the hip hop genre ...