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

Custom post type archive page filters

What is the proper way to filter my custom post type archive page by my custom taxonomies? When i go to archive page(archive-recipies.php), fetch me all the post under the custom post type. In this ...
0
votes
0answers
9 views

Query Two Different Taxonomies Nested

I have two seperate Taxonomy Categories that I have attached to a post type. I'm trying to run a query to display the results in a nested manner. I can't seem to figure out a way to make it work once ...
0
votes
1answer
26 views

How to have article URL like example.com/article1 and example.com/foo/article2?

By default, blog articles have an URL like example.com/article1. Changing Settings > Permalinks with /%category%/%postname%/ makes it possible to have URL like: example.com/foo/article2 Question: ...
-2
votes
0answers
32 views

is_main_query() unexpected results

I need to add product filtering using WooCommerce Attributes via URL vars, but have a small issue. While the below function will work, adding is_main_query() as a condition is preventing this to run, ...
0
votes
0answers
13 views

Filter taxonomy by CPT

I have the following code that shows all the categories within the "category" taxonomy, it works perfectly but I need to filter so that it shows only the categories of a certain type of CPT ...
1
vote
1answer
20 views

Order By Post Type ThenBy Taxonomy

Assuming I have these custom post types: Product Video Article And for Product (WooCommerce Product), we have many Categories, one of which is called "Parts". I have this situation where I ...
0
votes
1answer
27 views

Get term from multiple taxonomy

I am trying to show all the terms from these taxonomies. However, I can't get them working. Please help, thanks <?php $terms = get_terms( 'taxonomy' => array( 'category', '...
0
votes
3answers
100 views

Show subChild categories

Targets : Show Locations (sub-districts & cities) on the customized shop page & on tab additional information - Show on line 5 I'm building a property site using wordpress and woocommerce. In ...
0
votes
1answer
14 views

Category title output before opening title tag

I am using this code to add the category title to the category archive titles: function filter_events_title( $title ) { // Single venues if ( tribe_is_venue() ) { $title = sprintf('%1$s ...
0
votes
0answers
10 views

Visual composer custom element error

I am creating a custom element where I need to load woo-commerce product categories as dropdown (in visual composer element edit option) but I am getting this error. can someone tell me where is the ...
0
votes
1answer
5 views

Tracking the name of a custom taxonomy

For a site I need to show related posts for a custom taxonomy. Because another person build this site and also created a custom taxonomy, and this code can't be found in a proper file like functions....
0
votes
0answers
19 views

automatically select taxonomy based on post meta

hello i create custom post type using jetengine name listing for ecommerce website review and It have post meta platform a dropdown select box. this post type have taxonomy called payment method & ...
0
votes
1answer
9 views

update_term_meta() only updating once on certain meta keys

I set up 4 custom meta fields on a custom taxonomy, and for some reason the field values for my 2 text fields only update the first time they are added to the database. Either from including them in ...
0
votes
1answer
22 views

How to show related posts of category on post within custom posttype

We created a custom posttype called 'Handbook' and it has its own categories. Inside this handbook-category we have categories like 'fase 1', 'fase 2' etc. All the posts in this posttype got one of ...
1
vote
0answers
17 views

Set multiple Post Terms in same Taxonomy

I'm having a hard time trying to figure out this problem. I have looked at various StackExchange threads but nothing seems to work. Long story short. I have a custom table that updates every day which ...
0
votes
0answers
47 views

wp_insert_term doesn't want to enter its data into custom taxonomy

so I'm working on a code to take data from an array and put it in a custom taxonomy using wp_insert_tem, but the data won't go in. this is the json i want to fetch, this is from a url { "genres&...
1
vote
0answers
50 views

I write simple wordpress loop for taxonomy.php file but don't show result

I created a custom post type and create for CPT a taxonomy. but when I click on view taxonomy link don't work archive loop. I created taxonomy.php file for show this taxonomy in this file but display ...
1
vote
1answer
30 views

Redirect parent taxonomy to it's child

I am trying to redirect this url/investments/state/city/ to this url/investments/city/ custom post investments taxonomy structure: state 1 city 1 city 2 and so on. Any elegant solution?
0
votes
1answer
59 views

How can i change sort category view starting from child then parent, not alphabetically

I have created categories by city and districts. On the archive page, it displays well. The problem is, the views are sorted alphabetically. As a example : City (Jakarta) Districts 1 (Tebet) ...
0
votes
0answers
44 views

How can I order a post query's results based on the number of matching taxonomy terms?

Say I have a number of posts, across several post types. Each of these posts are members of several taxonomies. My queries will be AND across taxonomies, but OR within a taxonomy. I would then like to ...
0
votes
1answer
25 views

Output a specific link in Wordpress post if the single post's category's name contain certain word

I want to output a specific link in every post, depending on the post's category. For example, if a post is in "travel" category, then the link to https://www.example.com/travelbooking will ...
0
votes
0answers
23 views

Max number of terms in a taxonomy?

I need to create a taxonomy (or maybe I will use the standard post category one) with more than 13000 terms. In addition, the terms will be translated with WPML. Can this number cause a problem for ...
0
votes
0answers
33 views

$_POST sometimes empty even though isn't when using edited_[taxonomy] hook

I'm trying to save some term meta for some custom fields I have added via the [taxonomy]_edit_form_fields hook, I then save the data from these fields on edit with the hook action edited_[taxonomy]. ...
0
votes
1answer
18 views

ACF Taxonomy in Loop

How are you? My problem is the following on my front page I'm displaying some cards, for example name and description, this information is from my taxonomy called event because I created some fields ...
0
votes
0answers
33 views

Add terms to a taxonomy archive from within the same taxonomy

not sure if this is even possible (guessing it should be though)... I have a custom taxomomy of status, containing the following terms... pending, collecting, started, doing, dispatched, delivered, ...
0
votes
0answers
9 views

Exporting/Importing custom posts and taxonomy – how to maintain the same id's

In short I’m trying to use WP Ultimate Importer Pro to export all the posts in my custom post type of Talent, along with all of the associated categories (which include custom taxonomy categories of ‘...
0
votes
0answers
15 views

Taxonomy terms are not checked when edit custom post

The taxonomy terms selected are saved but when I edit post the taxonomy terms are no checked again, Does anyone know why this happens?
0
votes
1answer
78 views

Display related CPT with custom taxonomy

I have two custom post types: "storefront_location" and "services" These are linked by a custom taxonomy "location" I am building a post template for "...
0
votes
0answers
84 views

WP Query should show No Posts when tax_query $args taxonomies don't have associated posts

I have a simple query. Getting the posts only if it have both the taxonomies in it. $args = array( 'post_type' => 'treatment', 'tax_query' => array( '...
0
votes
0answers
13 views

Show taxonomy term in multi dropdown select checkbox wordpress

<?php /** The taxonomy we want to parse */ $taxonomy = "nearby_amenity_taxonomy"; /** Get all taxonomy terms */ $terms = get_terms($taxonomy, array( "orderby" => &...
1
vote
1answer
15 views

Set post terms on post publish

I am trying to set post terms on the post, when it is puublished I use following code but is doesn't work add_action('pending_to_publish', 'oj_publish_post'); function oj_publish_post($post_id) { $...
0
votes
0answers
49 views

mysql query for category and tag intersection

I am trying to build a query for a wordpress function to show categories for products, only if those categories contain products with a specific tag; so the shortcode should be something like: [...
1
vote
0answers
19 views

Hook for taxonomies needed

I am a newbie and spent now hours to no avail on this, so I really hope you can help me out here. One thing ahead: I do NOT want a plugin for this. I need to just change the word 'Cusine' (...
0
votes
2answers
35 views

Only show tag with the same id as the post

I have been stuck on the following case for a while now. On a page I have a list of tags which I try to filter. When the post for example has an ID of 10586, the only tag displayed should be 10586. ...
0
votes
1answer
16 views

Query all post and CPT from 2 specific taxonomies AND by ACF custom field

I need to build a complex query. I want to display all posts, and 2 different CPT posts in specific taxonomies. All of these posts need to have been checked to be displayed. The checkbox is added with ...
1
vote
1answer
71 views

Get term by slug in Gutenberg

In Gutenberg, one can use the getEntityRecord selector to get the data of a term of a specific taxonomy by its term id: // Get the category term with term id = 25 const term = useSelect( ( select ) =&...
0
votes
0answers
15 views

"Invalid taxonomy" with WP_Query's tax_query [duplicate]

In WP_Query using tax_query to get products in categories, I recieve "invalid taxonomy" error. Doing that in my child theme. It seems as if WordPress hasn't loaded taxonomies yet in the ...
0
votes
0answers
16 views

Is it possible to prevent the deletion of taxonomy by detecting $_GET request

Hooks are good and all, but I want to prevent the deletion of taxonomy by detecting $_GET requests if(isset( $_REQUEST['action'] ) && isset($_REQUEST['taxonomy'])) { if($_REQUEST['action'] ...
0
votes
0answers
17 views

WordPress 5.4 and higher: Filter posts by category 1 AND category 2 in API requests

We have a WordPress 5.4 instance that we query through it's API. I am hoping to find a solution for the following problem that works with newer versions as well. What I need is an intersection when ...
0
votes
1answer
24 views

Show recent posts from a custom taxonomy in wordpress

I create a custom taxonomy called "site". I cannot figure out what code to put in single.PHP to show related posts ONLY from "site" custom taxonomy. Please help.
0
votes
0answers
29 views

archive by year and category: permalink support doesn't work on pagination

I found here: Category archive by year with permalink support /category/YYYY the solution to obtain a category-by-year archive also supporting perma: function catyeararchives_init() { ...
0
votes
0answers
33 views

Wordpress Taxonmy Category Links 404

I was wondering whether I could get some help? I have created a custom post type and registered a taxonomy. Please see code below. However when I visit my taxonomy links, they either 404, or redirect ...
0
votes
1answer
24 views

Unique IDs for Post Types and Taxonomies

Sometimes I have duplicate IDs between Post Types and Taxonomies, I know this happens because they are stored in different tables but I wish it was possible to have a unique ID for each thing in WP, ...
0
votes
1answer
32 views

Get taxonomy singular name instead of taxonomy slug inside $taxonomy query

I'm trying to echo the taxonomy name inside a for each loop, instead of the category slug at this line : <div class="title"><?php echo $taxonomy; ?></div> I tried : <...
0
votes
0answers
24 views

If Term Name Exists, Append a Unique ID to Slug

How would I go about adding a unique ID to a custom taxonomies slug? We have multiple users who can create their own taxonomies. The problem occurs when two users wish to create a taxonomy of the same ...
1
vote
0answers
23 views

Taxonomy name repeating when showing 2 posts from each category

I am trying to get my page to show a custom taxonomy and then a the first 2 posts in that taxonomy, My taxonomy is called types post type is called guides I want the page so it shows like this Type 1 ...
0
votes
0answers
43 views

How to show only first, second, third Custom taxonomy conditionally

I have created a custom taxonomy names "colleges". Here I have added A, B, C, D etc custom taxonomy. And I want to show this taxonomy in single.php. <?php $args = array('number' =&...
0
votes
0answers
47 views

Rewrite Search URL Permalink For CPT Custom Taxonomies

My site uses a CPT with custom taxonomies and shows this URL for searches : https://example.com/?s=&post_type=listing&location=bridgeport&sale_type=for-sale&property_type=office But ...
1
vote
0answers
6 views

Display Featured Post by Categories and Avoid duplicated posts

I'm learning Wordpress development on Udemy and currently developing a theme. I haven't added any custom taxonomy but just using the "Post" and "Categories". Found a tutorial of ...
0
votes
1answer
54 views

wp_set_object_terms creates taxonomies but does not add custom posts to it

I am trying to call wp_set_object_terms in a function hooked to custom post creation (via wp_insert_post_data) to set taxonomies tags for the post from a custom field: $item_brand = ( ! empty( $_POST[ ...

1
2 3 4 5
38