Questions tagged [taxonomy]

A taxonomy is a generic "category" used to organize posts and custom post types

Filter by
Sorted by
Tagged with
0 votes
0 answers
2 views

One custom taxonomy with unique sets of labels for two post types?

I’m trying to use one custom taxonomy with different labels for different post types. I have the default “post” post type, and a “podcast” post type. Both post types have an associated Taxonomy with ...
0 votes
1 answer
2k views

Display specific taxonomy

I have a custom post type LOCATIONS I have a custom taxonomy LANDMARKS Under LANDMARKS, I have a list of building landmarks On some pages/posts, I want to be able to insert specific landmark from the ...
0 votes
2 answers
4k views

Get taxonomy url, name, post count & image

I'm attempting to display a specific taxonomy (channel) in the archive.php page. I want to display the taxonomy's URL, name, post count, and taxonomy image. This is what I have that's working so far: ...
0 votes
2 answers
782 views

taxonomy tags..it is not working

add_action( 'init', 'create_topics_nonhierarchical_taxonomy', 0 ); function create_topics_nonhierarchical_taxonomy() { // Labels part for the GUI $labels = array( 'name' => _x( ...
1 vote
2 answers
1k views

Hide product categories and taxonomy terms in menu if empty

I've been researching this and had no luck so far. I have a WooCommerce store with a main menu showing product categories (product_cat) and brands (yith_product_brand) which is a custom taxonomy. I ...
3 votes
1 answer
727 views

Count argument in get_terms has no effect on ouput/doesn't work

I'm trying to get a count of the categories that are subcategories of a category with the id $categoryId. In the documentation for the term query object, which is the primary argument to get_terms, ...
1 vote
2 answers
807 views

Get list of all custom tanonomy id

I created a custom taxonomy called Location then added New Jersey, New York, etc. Is there a Wordpress function that will get the list of all ids under the Location similar to what ...
1 vote
2 answers
1k views

Assign Taxonomy Based on Custom Field Value

I have a custom post type "vegetables" I have a series of custom fields for each month of the year as check boxes I have a custom taxonomy "Seasons" that I want to assign based on what boxes are ...
0 votes
1 answer
742 views

cannot create product attribute (taxonomy) and add terms on the same execution

I have the following functions to create a global product attribute and populate it with terms based on data from an API. protected function getOrCreateAttribute($slug, $name) { $...
0 votes
1 answer
863 views

How To Create Dynamic Permalink To Custom Taxonomy List of Current Posts?

I'm looking for help with a problem I've run into and can't seem to workout myself. I have created my own custom taxonomy called series (code below). I am calling the custom taxonomy posts in a widget ...
0 votes
2 answers
861 views

Show the parent taxonomy by creating shortcode in woocommerce?

How would I create a shortcode to show the parent taxonomy in woocommerce? My product categories should be like: - Food -- Fruits --- Healthy Fruits --- Organic Fruits -- Meat --- Pork --- ...
0 votes
1 answer
802 views

Get the tax term in which is a post via wp_query

I'll rewrite my original question because I feel like I can't be understood : I made a template page on which I have different WP_Query. I have a category taxonomy (countries). This template page ...
0 votes
1 answer
1k views

List all posts from custom post type by taxonomy

Having custom post types with taxonomies. Lets say I have a custom post type "Products" with taxonomies "new", "old", "fashion". Now I have a Nav where I can click on wordpress.private/products/new/...
0 votes
0 answers
8 views

WordPress Add/Edit Post right admin sidebar change title

How is it possible to change the "Tags" title on the right admin sidebar "accordion" and in the preferences of the block editor? See screenshots. I've tried changing $wp_taxonomies[...
0 votes
2 answers
734 views

Display Custom Column in CPT Taxonomy

I am trying to add a column to one of my custom post types, but only on the edit taxonomy page. I have a taxonomy registered called "event-categories" for my custom post type "events". I can ...
0 votes
1 answer
14 views

Filtering according to the locale 'de_DE'

I already have a filter to show on archive pages the terms of the taxonomy "tipologia" according to the locale = 'de_DE'. I need a similar filter to show in german the same taxonomy terms ...
1 vote
2 answers
1k views

category image taxonomy

I was using this solution for my problem, create a taxonomy for images without using any plugin, finded here: How to add upload field in a custom taxonomy? This is the code I use: function ...
0 votes
1 answer
16 views

Filter on one post type with taxonimy and get other post type

I would like to fetch my posts of type 'news', 'videos', 'webinars', 'whitepapers', 'testimonials', and 'landing-pages' and apply a "filter" to only get the landing-pages type with the ...
0 votes
1 answer
868 views

Display 3 level taxonomies

I'm a bit confused how to handle this kind of output. I suppose to display three level taxonomies. When a term is clicked i still need to display his level brothers but also his children's... The ...
4 votes
1 answer
1k views

Custom taxonomy on permalink

I have a long time problem and look forward for your help. I have a custom taxonomy of "city" (it is no hierarchical like tags). I just would like my URLs to look like this: /%city%/%category%/%...
0 votes
0 answers
3 views

Show Featured products with custom taxonomy template

I have a custom taxonomy template / archive called taxonomy-brand.php and this loops fine and shows the products that have the same "brand" taxonomy, trouble is I want to have a second loop ...
0 votes
1 answer
893 views

Category Archive not working for pages

I was wondering if someone could help me out. I have used this function: function add_taxonomies_to_pages() { register_taxonomy_for_object_type( 'category', 'page' ); } add_action( 'init', '...
1 vote
0 answers
12 views

When using get_terms with hide_empty = true, terms that only contain scheduled posts are not returned. How to override this?

My code is simply: $cats = get_terms( [ 'taxonomy' => 'category', ], ); Obviously, hide_empty is true by default. There's a category that only contains scheduled posts and it's not ...
6 votes
4 answers
12k views

Remove quick edit for custom post type

Is it possible to remove the quick edit function for a custom post type? I have 14 custom taxonomy with hundreds of terms in each and it takes too much time and resource to load all of them into the ...
0 votes
0 answers
15 views

Passing total post count to javascript

I have a ajax post loading program, I can load more post on click of a button. Problem im having is getting the button to hide or show less when no more post. I can query out the post count in PHP as ...
0 votes
1 answer
2k views

How to set acf color field as background color to product category

I have set an acf color picker field for woocommerce product category. I would like to set this color as a background to the category name that I've printed on the product page. I've tried to set the ...
-1 votes
1 answer
1k views

How to show amount of post in a taxonomy with advanced custom fields?

I am trying to display the post count of some taxonomies. I have a custom template that I am showing some taxonomies on. I am using advanced custom fields to assign each repeater field to a taxonomy....
0 votes
1 answer
3k views

hide_empty property not working when using get_terms

I want to display all categories including the ones with no posts assigned to it. So I found out about the 'hide_empty' property. Here is my code: <?php $args = array( 'taxonomy' =&...
0 votes
3 answers
1k views

Filter "get_terms" query

I'm currently getting the data from a custom taxonomy using this: $terms = get_terms(array( 'taxonomy' => 'my_custom_taxonomy_name', 'hide_empty' => true )); Now, this returns a lot of ...
1 vote
1 answer
2k views

WP_Query tax query part of slug

I have problem with filtering post with tax query. I have a custom taxonomy called 'actors' and example of the slug is 'david-hasselhoff'. The problem is the post is found when I search with 'david ...
0 votes
1 answer
782 views

Custom taxonomy and query multi conditions

I have this query $query->set( 'tax_query', array( 'relation' => 'OR', array( 'taxonomy' => 'location', ...
2 votes
1 answer
792 views

Disable WordPress Recognizing Path as Attachment

Whenever you enter an URL with two path segments that doesn't exists, WordPress will automatically parse the query as an attachment. How to reproduce Change you permalink structure to /%postname%/. ...
0 votes
1 answer
11 views

How reorder post tags taxonomy in the non-alphabetical custom order and save it in the Block Editor

I see that Wordpress always sorts tags in the Block Editor in the alphabetical order. How can I prevent this behaviour? I have found a good article with an approach which uses term_order field from ...
0 votes
1 answer
1k views

WooCommerce WP_Query using tax_query returns no results (0 = 1)

I am trying to get specific Products from WooCommerce baseed on a Product Attribute (taxonomy). $args = array( 'post_type' => array('product', 'product_variation'), '...
1 vote
1 answer
983 views

How to show taxonomy image instead of taxonomy name on a list

I would like to show in a custom taxomony list icons instead of taxonomy name , but just for the ones with image asociated, where there is no image let show the taxonomy name . i have installed ...
0 votes
1 answer
970 views

taxonomy_edit_form_fields output after term fields

I'm using the following code to create a custom metabox on a custom taxonomy page. $term_filter_name_edit = $type . '_edit_form_fields'; add_action($term_filter_name_edit, 'box_term', 1000, 1 ); ...
0 votes
1 answer
843 views

Custom Taxonomy Page redirect 404

I have a custom post type 'BLOG'. I created archive-blog.php file to display archives. Also I register a taxonomy with it named as 'blog-category' and created a page 'taxonomy-blog-category' while ...
0 votes
1 answer
27 views

Taxonomy question how to add more data

Normally taxonomy has a name and a value in the template I'm using it has a name value and what they call category what I'm wondering is what function call in PHP do you use to set that category I ...
0 votes
1 answer
726 views

Displaying subcategories and then posts in taxonomy template

I have a custom post type 'downloads' which i have a have a custom template set up to get terms of to begin with. Im now trying to set up my taxonomy template so that it displays sub-categories if ...
0 votes
1 answer
31 views

How to get parent and child sub category (Taxonomy) order to display

Trying to get my list of categories to display the child after the parent. For Example Parent Category Child Category child category Parent Category child category Current code <aside ...
1 vote
1 answer
2k views

Multiple tag cloud filtering

I am writing a plugin which creates a custom post type and two associated custom taxonomies. The custom post type list/archive page should be filterable by terms in one or both taxonomies i.e not just ...
1 vote
1 answer
984 views

How to Restrict Previous & Next Post Link to Posts of Same Category?

I am using a category to segregate all posts of that one category to feel like a complete website sub-section. So the main posts feed is using a plugin to hide posts of that category, and I am using a ...
1 vote
1 answer
2k views

Duplicate Custom Post Type and Taxonomy Slug

I've seen a few questions that are very similar, but I haven't been able to get an exact answer, so I'm going to explain my situation here. Quite simply, I need the following url structure: site.com/...
0 votes
0 answers
23 views

Taxonomy term archive claims there are no posts, but there are. How to resolve?

I have a custom post type (url), and a custom taxonomy term (url-category) for this post type. The archive page for this custom post type works fine. The taxonomy term archive claims there are no ...
0 votes
0 answers
9 views

Change taxonomy key of existing and future taxonomy posts

I registered a taxonomy with a certain key name, initial_name, and now there are hundreds of posts in a custom post type with this taxonomy selected that I don't want to lose the connection with (the ...
1 vote
2 answers
4k views

How to "group" (categorize) the Pages together?

I have a lot of Pages which can be (need to be) grouped under a number of different Categories. ** Then the more important thing is, i need to control those pages (of different groups) programatically ...
0 votes
2 answers
968 views

how do you get one specific term from a shortcode attribute?

I'm working on a function where I just want to output a button that links to a specific term. I have used get_the_terms and have gotten it to work successfully, but I've been trying get_term and I've ...
0 votes
1 answer
1k views

Show portfolio category slug in url ( if exist)

I'm trying to achieve a two level portfolio structure, and it works fine in the breadcrumbs but not in the URL. The idea is to show the portfolio slug (destinations) followed by the portfolio category ...
2 votes
1 answer
2k views

List post from current taxonomy children

I have a custom post type and a taxonomy with children, with a template file named taxonomy-productcategories.php. On this i want to list all children with their posts. Child taxonomy 1 Child ...
61 votes
13 answers
88k views

Using wp_query is it possible to orderby taxonomy?

My question is simple, I'm using WP_Query to retrieve some custom type posts filtering by a taxonomy using tax_query. Now my problem is I would like to orderby the taxonomy, but from documentation ...

1
2 3 4 5
40