0
votes
2answers
52 views

Order get_terms using a Custom Field

I have a custom taxonomy of "crb_issues" that has a custom field associated with it that is "issue_date" which outputs a date value for each term to looks a lot like "20140601" yearmonthday. I am ...
0
votes
2answers
22 views

get_terms() doesn't return empty terms even though hide_empty is false

I can't manage to make get_terms() to return the empty terms and I've tried it in a number of ways. Here's the code: $terms = get_terms('device',array('hide_empty' => 0)); foreach($terms as ...
0
votes
1answer
47 views

Listing child terms of parent term

I'm using the following code to generate a list of only the child terms within my taxonomy. What I'd also like to do is display a list of the child terms for each parent category on a ...
0
votes
1answer
39 views

get_terms - only top level

I am trying to get only top level term: $cat_args = array( 'parent ' => 0, 'number' => 10, 'hide_empty' => false, ); $categories = get_terms( ...
0
votes
1answer
29 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
48 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 ...
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 ...
0
votes
1answer
39 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
106 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
48 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( ...
0
votes
1answer
129 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
107 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
0answers
76 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
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
2answers
60 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
1answer
219 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
537 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
87 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
901 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; ...
0
votes
3answers
129 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
193 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
133 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
109 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
196 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 ...
0
votes
1answer
998 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
0answers
202 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
1answer
264 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( ...
0
votes
1answer
684 views

Add filter to Admin list for all custom post types by their custom taxonomies

I want to add filter on every Custom post type that have taxonomy associated with it. I have googled but found code for only for single post type or for single taxonomy.
0
votes
1answer
922 views

get_term_link not working

I am trying to use the below code snippet to display an image and then wrap it in a link to a specific term archive page. In this case, I have a custom taxonomy (Series) with a few different terms. ...
0
votes
1answer
121 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
239 views

How to break up php code to avoid echo

I have this php code I am using to list all post (titles) with the taxonomy categories names, and its working fine however I will like to break it up and avoid using echo within the php code so that I ...
0
votes
1answer
79 views

Retrieve Custom Taxonomies with Description and Slug

I've been looking to grab a list of custom taxonomies for a custom post type with the titles, descriptions and tag but have not been able to progress or find anything helpful. Breakdown: I have ...
0
votes
1answer
197 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): ...
2
votes
2answers
9k views

Display current taxonomy term when inside custom post type

Well, this should be pretty simple, however I couldn't find answer anywhere on the web. all answers I found were close but no exactly what I needed. what I need is to display just the current term of ...
1
vote
1answer
194 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
686 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
1answer
392 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 ...
1
vote
1answer
227 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
588 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
510 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 ...
0
votes
2answers
188 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 ...
0
votes
1answer
191 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
532 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
226 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 ...
4
votes
1answer
211 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
1answer
993 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 ...
1
vote
3answers
374 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 ...