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
0answers
22 views

Get related posts of child term of custom post type

I want to show related posts of my child taxonomy term from taxonomy terms of custom post type. CPT: project Taxonomy name: preferences Parent term: 2BHK, 3 BHK Child term of 2 BHK: completed ...
0
votes
0answers
24 views

Filtering posts in category by tag URL

I'm still learning WP, so this might seem pretty obvious to veterans. I've been given admin rights to a WordPress site and told to replicate what my predecessor did with a specific pair of pages. ...
1
vote
0answers
12 views

How to add textarea field to taxonomy (tag)?

How can I add custom field (textarea) to wordpress taxonomy (tag)? add_action('admin_init', 'tag_custom_fields', 1); if( !function_exists('tag_custom_fields') ) { function tag_custom_fields() { ...
0
votes
1answer
40 views

Template taxonomy-{taxonomy}.php doesn't show my posts

I have a simple issue that can’t solve. I have a Custom Post Type called “Hardware” and inside a taxonomy called “hardware_category”. I'm trying to display a list of my custom posts in each term with ...
0
votes
0answers
9 views

How to get value of custom taxonomy filed using the term slug

I have a taxonomy 'topics'. There are multiple fields that I have created using Toolset. I want to get the value of a particular field for that slug. How do I get that. I have used var_dump(get_field('...
1
vote
0answers
18 views

Limit amount of posts made within a custom taxonomy

Is there a way to limit the number of posts that can be created within a custom taxonomy? I have a custom post type called Preferred Agents and a custom taxonomy called Agent Location. I want to be ...
0
votes
0answers
33 views

Same base slug for CPT post and CPT taxonomy terms

Variations of this issue have been posted a few times over the years however after going through all of these I have been unable to find a solution. We need to have the same base slug for CPT post ...
0
votes
1answer
32 views

Rewrite custom post & taxonomy to share same URL path

I have a custom taxonomy (video-category) for a custom post type (video), and I'm trying to rewrite their paths in line with the examples below: Post (Archive): about-us/video-center/category-name ...
0
votes
2answers
28 views

Display related terms from a taxonomy in an entry

I have a function to obtain specific taxonomies in each entry. The problem is, for each entry, it shows all the values that the taxonomy contains. How can I do to show the correct value to each entry? ...
0
votes
1answer
21 views

Want to hide some categories from the categories meta box in the post editor for the two specific user roles

Recently, I am customizing the COLORMag theme in WordPress. I want to make my site as a multi-author website where random people will register and write. But as my theme's homepage shows all the posts ...
0
votes
1answer
22 views

Custom Taxonomy Is Being Pulled into a Page, But It Doesn't Have A Hyperlink

I have a WP_Query class on the home page of a site that pulls in a custom post type, and as part of this I want to show the custom taxonomy (category) for this post type. The solution I currently ...
0
votes
1answer
23 views

I receive taxonomy id

Hello i want to get the value from field but i receive the id code is here: function add_product_column( $columns ) { //add column $columns['new_column'] = __( 'New column', 'woocommerce' ); ...
0
votes
0answers
13 views

Wordpress Portofolio Conditional Templating - functions php

I'm trying to load some code depending on which portfolio category i am , but cant seem to get it quite right... I've read that portfolio categories are called taxonomies, but don't know if thats ...
0
votes
1answer
9 views

What is the use case for sharing a term between multiple taxonomies?

The WP_Term::get_instance() method, used by get_term() and presumably other core API functions, accepts an optional $taxonomy arg that is "only used for disambiguating potentially shared terms." What ...
0
votes
1answer
30 views

Update a list of product to featured if product have meta value (Mysql not wpquery)

Since woo 3 featured product is name and slug of taxonomy 'product_visibility'. I need to update all products with same meta_value contained in list to 'featured'. My products have a meta_key = '...
0
votes
0answers
18 views

How to separate an overgrown blog into sub-blogs – without breaking existing inbound links?

I have a single WP install that has accumulated a mix of content, large subjects of which I want to separate into something resembling their own blogs. Example: Among the pages and posts on myblog....
0
votes
1answer
16 views

how do you pull data from two taxonomies?

I have posts loaded from taxonomy, but I'm trying to get the data of another, that's also attached to the same post. In the code below, the main focus is getting $location_slug. Knowing how to get ...
0
votes
2answers
51 views

List just subcategory and products of active category page in Woocommerce

Working on a category page - taxonomy-product_cat.php - I want to list all the subcategories of that category page, with all its products. I would think it is simple enough but I cant get it to work. ...
0
votes
1answer
19 views

Create custom post type categories

I've created a CPT called 'Projects' in WP using pods. If I now go to the categories sub menu for this CPT I am presented with a long list of categories that were created for the specifically for the ...
0
votes
1answer
33 views

List taxonomy term slugs within shortcode (do_shortcode)

I'd like to list the taxonomy terms within my shortcode. This is how I get the list of terms (separated by commas): <?php $terms = get_the_terms( $post->ID , array( 'shoptype' ) ); ...
0
votes
0answers
19 views

Output taxonomy by picked order

quick question... I have a taxonomy associated with a custom page type. When choosing them in the custom page I want to preserve the order by which item I choose first. How can this be achived? Or ...
0
votes
0answers
20 views

How to make 'show_option_all', that comes from wp_list_categoreis, to work with get_categories or with get_terms?

My problem is that I want to make an ajax category filter, where it shows the categories, but also to have a button "all Posts" so the user can go back to viewing all posts. My current code is using ...
0
votes
1answer
25 views

Custom query for certain post type OR another post type with a certain category

I want to display posts that are either EITHER Post Type A OR Post Type B but ONLY if they are also in CATEGORY 1 Is that at all posible? How do I built my custom query?
0
votes
0answers
22 views

problem : Custom taxonomy template not showing

I make a custom post type and a custom taxonomy for that but the template of my custom taxonomy return error 404 , for example local/mywebsite/people/catea show error 404. function web_people() { ...
0
votes
0answers
15 views

Can selected taxonomies be used dynamically to display information?

I’m creating a business directory site in which users will create a business listing and while creating that listing, select certain amenities they offer. I’ve created several taxonomies to be used ...
0
votes
0answers
9 views

Get name of all term which is duplicate using Mysql

I am coding something to get all duplicate term which has duplicate name using MySql query. The issue I have currently is I am getting the records in a single occurrence I need all data which has same ...
0
votes
1answer
27 views

delete category on plugin deactivation wordpress

I am trying to delete the category dynamically when the plugin is deactivated but it is not deleting But it is adding on activation properly the only problem is deletion of category on deactivation. ...
0
votes
0answers
29 views

How to add CSS class field in Custom Taxonomy?

This is my code for custom taxonomy register_taxonomy( 'job_location', 'noo_job', array( 'labels' => array( 'name' => __( 'Job ...
0
votes
1answer
22 views

Single and Archive Pages with Custom Post Type

I have a custom post type // Set other options for Custom Post Type $args = array( 'label' => __( 'document', 'ecse' ), 'description' => __( '...
0
votes
1answer
19 views

Show template part if part of term

I'm not an educated programmer, but usually i can put existing code together so it works the way i want it to. But this time i'm lost, i feel like i've tried everything. I'm trying to only show a ...
0
votes
0answers
18 views

Add custom post type slug before custom taxonomy page

Good part of the day for everyone. I have a taxonomy page, which attached to specific custom post type. When i go to taxonomy page, it's URL hasn't contains custom post type slug. Example: http://...
0
votes
0answers
19 views

Parent Category and Subcategory default text generated with category

I need help on something I am unable to do on my website. I have several category and sub category on my page. For E.g Food -Apple -Orange Shirt Laptop -HP -Dell I would like on each category page ...
1
vote
0answers
21 views

Taxonomies on custom taxonomies

I have a custom post type with multiple custom taxonomies. I need those taxonomies to have a relationship as well. The trick is, I need a child to be able to have multiple parents. I understand that ...
0
votes
1answer
36 views

Get WooCommerce product category list in functions.php

I am trying to create a an array of WooCommerce product categories to use as a dropdown in the Customizer. The following code is working in a function hooked to 'customize_register' but not in ...
1
vote
0answers
17 views

Issue on Creating Custom Tax Term Dynamically From Another CPT Meta-box On Publish

I have two Custom Post Types called book and publisher. The book has two Custom Fields (Metabox) author_fname and author_lname and the publisher has a Custom Taxonomy called authors Now can you ...
1
vote
1answer
37 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 ...
1
vote
1answer
27 views

Function get_queried_object() return NULL in custom taxonomy

Hi i need get term ID from custom taxonomy but it is always NULL. taxonomy-galerie-kategorie.php <?php /** * A custom taxonomy template for gallery. */ ?> <?php ...
1
vote
0answers
16 views

How to join result of different taxonomies?

I need to search properties by cities and areas at the same time. So I created two query to take all the references of the cities, and the areas: $city_query = "SELECT * FROM $wpdb->terms t INNER ...
0
votes
0answers
22 views

Rewrite rules for custom taxonomies

I got car custom post type. And got custom taxonomies (model, year, color) for car post_type. Car archive link looks like this: https://example.com/car/ And i am filtering this archive page with $...
1
vote
1answer
20 views

Why “Warning: Invalid argument supplied for foreach()”

The following code gets the "organisation" taxonomy terms associated with the last 20 "article" or "viewpoint" posts. First, it gets the posts, $recent_posts. Second, it pushes each of those "...
1
vote
0answers
21 views

Display specific categories by ID

I have three parent categories with child cats belonging to each, Project Type, Sector and Country. Currently the code I have displays all categories by default when selected. $categories_in_text = ''...
0
votes
0answers
14 views

List all categories that have results in a query

I have an archive page that I am building multi-filtering for. The archive page lists paginated results from a custom post type, and there are 3000 posts within it. I would like to be able to filter ...
0
votes
1answer
17 views

How to create a non removable taxonomy term?

I have this question but it refers to frontend How can make an unremovable term in the backend similar to uncategorized? Thought it could be renamable I believe the slug or ID will remain the same. ...
0
votes
0answers
47 views

Why can't pages be categorized / tagged?

I'm having a hard time understanding the design choice to not allow pages to be categorized / tagged. Why exactly is this and what issues enabling that functionality for pages could create?
0
votes
0answers
12 views

How to group custom posts in admin menu based off taxonomy/postmeta

I created a custom post type named cars and I am trying to find a way to display the posts in my admin menu where it will group the posts based off either taxonomy or postmeta by car manufacturers, ...
0
votes
0answers
9 views

Taxonomy term hierarchy to work with single post as well as taxonomy pages

I have a website which has a CPT of products and product categories with subcategories. I want the url sctructure for taxonomy pages and single pages to follow url/products/term/single-product and url/...
0
votes
0answers
15 views

How to quickly fix duplicated term slugs in hierarchical taxonomies?

my problem is that I've imported in wordpress some hundreds of terms of a custom taxonomy, from another system, in 5 languages. I've found out those terms have sometimes duplicated slugs, and they're ...
0
votes
1answer
22 views

Post Taxonomy Value get from User Field Value

I have user field such as "gender and country" on register form (Created with ACF). Also I have post (wp default posts and CPT) taxonomies called "gender and country My member can create unlimited ...
2
votes
2answers
305 views

How to return a list of custom taxonomy terms via the Gutenberg getEntityRecords method

This method for @SE How would I get a taxonomy/category list inside a Gutenberg block? does NOT work for custom taxonomies, e.g.: wp.data.select('core').getEntityRecords('taxonomy', 'my-custom-...
0
votes
1answer
38 views

Can I get thumbnail of taxonomy?

<?php $args = array( 'type' => 'itineraries', 'child_of' => 0, 'parent' => ...

1 2 3 4 5 35