Questions tagged [custom-taxonomy]

Since WordPress 2.3, plugin and theme authors have had the ability to create custom taxonomies-- essentially specialized "categories"-- to help organize information.

Filter by
Sorted by
Tagged with
0 votes
1 answer
92 views

Dynamically count the number of custom post types associated to a custom taxonomy

I have two custom post types, "participants" and "reports". Both of them are associated with the custom taxonomy "year". So in the post "report 1" that is ...
Adriano Marques's user avatar
0 votes
1 answer
71 views

How to automatically compare date from custom post type with current date and change taxonomy based on a result?

I have a local WordPress website installment. I have custom post type "tours" and a custom taxonomy connected to it called "active-past". This taxonomy has two terms "active1&...
Trombolo's user avatar
0 votes
1 answer
192 views

How to make multiple custom taxonomies sit under custom post type slug?

I have a custom post type called resources which has been registered as so: register_post_type( 'Resources', theme_build_post_args( // $slug, $singular, $plural 'resources', 'Resource', '...
Freddy's user avatar
  • 147
2 votes
1 answer
116 views

Custom taxonomy with custom meta value is not sorting correctly (query returns the same value for orderby regardless of sort column click)

I have a weight class category, where I want to sort by weight so Heavyweight shows at the top, and Flyweight at the bottom. I have created a custom meta field called 'weight' where I store an int ...
Mac Cooper's user avatar
1 vote
2 answers
1k views

Custom Sort Order for Custom Post Type Taxonomy

I have a custom post type - Demo Tours And for that CPT I created a Custom Taxonomy - Demo Tour Categories. Each Demo Tour may have one or more category. Each category has Custom Field - Category ...
strangedenial's user avatar
0 votes
0 answers
201 views

Hide empty categories on widget

I excluded some products from woocommerce_product_query with this code: function en_archive_products_by_rol( $query ) { if (is_admin()) { return; } $meta_query = (...
Elianalu's user avatar
2 votes
1 answer
33 views

Is it possible to use a post name in a custom post slug?

So I have custom post type called Lessons and I am using something like this for the slug register_post_type( 'Lessons', // CPT Options array( 'labels' => array( ...
Zarko Zivkovic's user avatar
0 votes
2 answers
724 views

Gravity Forms with Advanced Post Creation Add-On not updating ACF fields on custom taxonomy

I've tried everything I can think of and read about. I cannot seem to figure out why this doesn't work, let alone get it to work. I have a Custom post type called Talk. That custom post type has a ...
whakawaehere's user avatar
1 vote
1 answer
26 views

Complex Custom Loop with Includes

The Problem I have a complex loop designed for showcasing my portfolio. Here is the criteria: Portfolio is powered by a custom post type called PORTFOLIO Each post will be assigned a class of either '...
Sabotawsh's user avatar
3 votes
1 answer
121 views

Registering custom taxonomy using reserved terms

I'm using CPT UI to manage all my custom CPTs and taxonomies. I've tried adding custom taxonomy with slug type, and CPT UI displays an error saying that type is reserved term. Now, if I try ...
errorous's user avatar
  • 169
2 votes
1 answer
50 views

WordPress Two Level Filters on Getting Custom Taxonomy Terms

I have a Custom Post Type Called movie and I have two taxonomies genre and quality associated with that. Now I need to get/filter all terms IF genre = 'action' AND quality = 'HD' Using this code I ...
Behseini's user avatar
  • 525
0 votes
0 answers
20 views

Taxonomy term template is not working

I have such a question, there is a taxonomy 'custom' for example, and it has a term 'speacial'. And I want this term to hook my custom template. For standard taxonomies, taxonomy-custom.php is ...
Alexey's user avatar
  • 1
2 votes
0 answers
204 views

Query custom post type and group by taxonomy

I struggle a bit with my piece of code - it's main goal is to show list of custom post type (called "career") childs grouped by custom taxonomy. How it should work? A user see default list ...
Julia Galden's user avatar
0 votes
2 answers
399 views

I want to show image from custom field image on my custom page template

I have created a taxonomy and in that taxonomy i have created custom field for image. Now I want to show that custom field image on my custom page template with category name. I have tried much it is ...
Abdul Rasheed's user avatar
4 votes
1 answer
82 views

Theme template file for a specific custom taxonomy

Is it possible to create a template file specific for a custom taxonomy? For example, I have music Custom Post Type and it has three taxonomies artist, album, and genre. So the hierarchy would be like ...
agent abstract's user avatar
1 vote
1 answer
105 views

Sub-pages of Custom Taxonomies

I am trying to create fixed sub-pages of a custom taxonomy, which is more vexing that it might sound. Here's a scenario to describe the problem: Let's say you have a website about movies. You write ...
Michael Rexman's user avatar
1 vote
0 answers
131 views

Get category name of current post (CPT UI)

I used CPT UI to create custom post types "Job Offers" which has a taxonomy with slug "job_offers_categories". In the CPT Categories I have 4 categories: Exchange Programme Job ...
Loizos Vasileiou's user avatar
0 votes
0 answers
16 views

Show a wordpress custom post condtionally using a category term

I created a custom post called sliders with a custom taxonomy slider_cat. It's for a restaurant and every Wednesday I want a specific post to show only on that day. Find my code attached: <?php $...
Tar Akiga's user avatar
0 votes
0 answers
20 views

How to use wp_set_object_terms depending on page ID?

The function to set custom term works fine. add_action( 'save_post', 'set_custom_term', 30, 2 ); function set_custom_term( $post_id, $post ) { wp_set_object_terms($post_id, 'guitar', 'instrument',...
Kim Caspe's user avatar
0 votes
0 answers
16 views

How do I organize posts based on their taxonomy?

I have a huge assortment of posts. They each belong to a taxonomy (let's say Taxonomy 1, Taxonomy 2, Taxonomy 3, and Taxonomy 4). On the page where they are displayed - I wanted them to be displayed ...
Gabry's user avatar
  • 1
0 votes
2 answers
22 views

Not Able to Access Terms Under Custom Taxonomy Archive

Having a Custom Taxonomy called movie-genres 'rewrite' => array('slug' => 'movie-genres', 'with_front' => true) ); register_taxonomy( 'movie-genres', array( 'movies' ), $args ); And I have ...
Behseini's user avatar
  • 525
0 votes
3 answers
272 views

Hide custom post type slug url from search engine [closed]

I want to hide, let's say, example.com/services/washing ('Services' is the this is a custom post type) from the search engine and show a 401 error page. How do I?
Warda's user avatar
  • 105
0 votes
1 answer
582 views

Display posts from specific slug of the custom taxonomy in Wordpress

I have this piece of code, but what I really want to do is to get all post displayed from my taxonomy. Where do I place my taxonomy slug to make sure only a certain category posts are displayed? The ...
Piotr Ciszewski's user avatar
0 votes
1 answer
586 views

Add Gutenberg editor to edit taxonomy (category) page

I have created a custom post type and custom taxonomy. I need to allow editing a taxonomy page in Gutenberg, but WordPress allows me to use only certain fields. How can I overcome this problem? ...
Piotr Ciszewski's user avatar
0 votes
1 answer
210 views

Show custom category archive as front page and remove taxonomy slug from urls

I have an art portfolio site in development. I have used CPT UI to set up: post type: works taxonomy: mediums mediums: paintings, etc The best way I could think to set this up was to use taxonomy-...
WP Shala's user avatar
0 votes
1 answer
1k views

Add custom display condition to Elementor Theme Builder for custom taxonomy children, grandchildren, and great-grandchildren

I have a few templates built with Elementor Theme Builder. However, the option to display them on nested archives is quite limited. Here's my case I have a custom taxonomy (tags) called Locations. ...
mardag's user avatar
  • 1
0 votes
1 answer
76 views

Adding terms to custom post type - incorrect term being applied

I have a custom post type, with a custom taxonomy. I am trying to apply two terms to a post. $term1 = 35; $term2 = 36; wp_set_post_terms( $this->postId, [$term1, $term2], "my_tax"); ...
StripyTiger's user avatar
0 votes
1 answer
43 views

List posts grouped by children of a custom taxonomy

I am successfully listing posts grouped by category from a custom taxonomy like so: Category 1 Post Post Post Category 2 Post Post Post Category 3 Post Post Post Category 4 Post Post Post I am ...
quantum_leap's user avatar
1 vote
0 answers
62 views

Give attachments an archive page, and exclude unattached ones

I am extending the use of Media/"Attachments" so that they have a custom taxonomy of "Medium" and I can display taxonomy archives on the frontend. I'd only like the archive query ...
kanga's user avatar
  • 111
0 votes
0 answers
31 views

Guest author - URL, base and custom taxonomy - working but unstable

I've had help here in the forum to create a custom guest-author taxonomy, custom guest-author url base and to redirect the main author's url (logged WP user) to the guest-author's url. It is all ...
usina's user avatar
  • 13
0 votes
0 answers
79 views

From form submission values - dynamically update CPT "has_archive" slug and custom taxonomy "rewrite" slug value

I have defined a CPT and corresponding taxonomy like this - function my_custom_post_type() { register_post_type( 'my_sample_cpt', array( 'public' => true, 'has_archive' =...
Anand's user avatar
  • 1
0 votes
1 answer
29 views

Code to show related posts (custom post type and custom taxonomy/category) is messing with other code

I'm using a code to show related posts on the page on one of the posts. It works OK, but I've just noticed that it makes the next part of the code to stop working as expected. $custom_terms = ...
migueltic's user avatar
  • 105
0 votes
0 answers
66 views

Hook to filter based on form value and insert term

I am working on a form where I am trying to insert a term to a taxonomy. So I have a drop down select with a list of my taxonomies and then the next field is a simple text field where the users will ...
spyfly's user avatar
  • 1
0 votes
0 answers
154 views

Change get_author_posts_url / Author URL via filter

I have a follow-up question to this answer here: Create guest author page via php I would like to modify the get_author_posts_url function to get a custom taxonomy guest author slug. I need this ...
usina's user avatar
  • 13
1 vote
1 answer
224 views

How to change custom post type slug without damage seo? [closed]

I need to change the structure of the taxonomy which holds a list of products, actually I have this implementation: http://example.com/watches-product/category/product-name/ but this should be: http:/...
sfarzoso's user avatar
0 votes
2 answers
31 views

Display terms on product page with shotrcode

I need to add some shotrcodes for many taxonomies and I would like to display the value terms on a product page of woocommerce. I tried with this but doesn't work, in this case the taxonomy name is &...
Marco Fabris's user avatar
0 votes
1 answer
37 views

How can I show second most recent post in sidebar, if most recent post is open in the browser?

I am working on an online magazine in WordPress PHP. I created a custom post type (article) with 4 available custom categories. In the sidebar I want to show the most recent post of all the 4 ...
Curious Programmer's user avatar
0 votes
1 answer
206 views

get_the_terms inside save_post gives old terms

When I use get_the_terms inside save_post, I get the old taxonomy terms. This is something that I would expect from pre_post_update, but why does it happens to save_post ? And, more important, how to ...
Tahi Reu's user avatar
  • 236
0 votes
0 answers
111 views

add_rewrite_rule pagination 404 error on page 4 and above

I am working on a site using Wordpress 6.0.2. Astra is the theme and I am using Elementor Pro. I have lots of custom post types and taxomonies. I am using add_rewrite_rule like this: add_rewrite_rule( ...
Steve Hoare's user avatar
0 votes
0 answers
175 views

Search and filter with custom field in taxonomy

I have created additional fields for myself in taxonomy. Now I would like to do a search using the values entered into them. I have a problem with this. What is wrong here and how should it be? I'd ...
syntaxpl's user avatar
0 votes
0 answers
65 views

Exporting CSV of users with custom user taxonomies out of Wordpress

I'm trying to export a CSV or XML out of a WordPress site that has custom taxonomies added to the users. The site I'm working with adds custom taxonomies following the format here. Plenty of export ...
PHS's user avatar
  • 61
0 votes
1 answer
151 views

register_term_meta not working

I have a simple code snippet, and seems like I am missing something obvious. add_action( 'init', 'custom_term_meta_setup'); function custom_term_meta_setup() { register_term_meta( 'procedures', '...
Tahi Reu's user avatar
  • 236
0 votes
0 answers
36 views

How do I create a term for every value of a post meta?

I have some information stored in post meta that I'd like to convert to terms. I'd like to create a term in a custom taxonomy for every meta value with a particular key. I need to loop through ALL ...
DJZEEGLER's user avatar
  • 119
1 vote
1 answer
127 views

How do I change the Go To Categories link in the term_updated_messages

I have a custom taxonomy titled "shows". When a show gets updated it displays a message to the user followed by a link. I have already changed the message by using add_filter('...
Jason's user avatar
  • 205
0 votes
0 answers
37 views

Taxonomies starting with a hyphen (minus) to assign B.C. dates to a post

I have a date slider to filter posts in the archive by a custom taxonomy that assigns specific years to each post. I would also like to assign B.C. dates to some posts. I figured this would work best ...
RaWa's user avatar
  • 3
1 vote
0 answers
23 views

Links in archive not including taxonomy parameter

I've created a custom content that can belong to several categories: status, age and specie. For now there are only the following terms for these taxonomies: species: dogs, cats age: adult, young, ...
JPFs's user avatar
  • 11
0 votes
1 answer
424 views

cannot export data from CPT UI (books)

I am working on migrating a website that was built with CPT UI & 'Advanced Custom Fields.' The intent is a library of translated books, and the custom taxonomy from these tools permitted the books ...
yitzhak's user avatar
0 votes
0 answers
118 views

the_post_navigation in single page with multiple taxonomies

I am creating a custom content that can belong to several categories: status, age and specie. For now there are only the following terms for these taxonomies: species: dogs, cats age: adult, young, ...
josepfs's user avatar
0 votes
1 answer
201 views

wp_get_object_terms count on taxonomies within an category archive

Working on a category archive, i have a sidebar with custom non hierarchical taxonomies, used as filters (like custom post_tags). In order to list those filters, I use wp_get_object_terms: <?php ...
rafa226's user avatar
  • 111
1 vote
1 answer
119 views

Custom Post Types using wrong template (index) instead of archive-{type}.php - previously worked as expected

I have several custom post types on a site where top-level nav items use archive-{post-type}.php templates of the post types. These have recently had a template problem and they now use the index.php ...
Mike's user avatar
  • 23

1 2
3
4 5
90