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
142 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? ...
0 votes
0 answers
15 views

Same slug for Custom Taxonomy archive and CPT archive - Rewrite rule not working

I’m using a CPT (wg_seo_chat) together with a Custom taxonomy (wg_chat_category). Additional rewrite rules are in place to inject the Taxonomy into the URL: CPT archive: domain/hilfe-chat Taxonomy ...
0 votes
1 answer
80 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-...
0 votes
0 answers
199 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. ...
  • 1
0 votes
1 answer
37 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"); ...
0 votes
0 answers
15 views

Save selected terms in order of custom taxonomy in post

My goal is to save the terms in the order in which they are selected, to display the same order in the front end. I have a custom taxonomy, user can select many terms of this taxonomy when they are ...
0 votes
1 answer
21 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 ...
1 vote
0 answers
29 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 ...
  • 111
0 votes
0 answers
15 views

Group custom taxonomies based on tags contained in their posts

I have a piece of code that shows links to children of a parent taxonomy on archive pages. My goal however is to separate these children into groups, based on the tags (standard WordPress tags). My ...
  • 43
0 votes
0 answers
29 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 ...
  • 13
0 votes
0 answers
35 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' =...
  • 1
0 votes
0 answers
14 views

Make custom post type display with custom taxonomy in url

I have been attempting to show my products with a custom taxonomy in the url, as such: [site]/products/product_category/product Where products is a custom post type, product_category is my custom ...
0 votes
1 answer
25 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 = ...
  • 105
0 votes
0 answers
31 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 ...
  • 1
0 votes
0 answers
80 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 ...
  • 13
1 vote
1 answer
101 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:/...
0 votes
2 answers
30 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 &...
0 votes
1 answer
17 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 ...
0 votes
1 answer
74 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 ...
  • 186
0 votes
0 answers
41 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( ...
0 votes
0 answers
78 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 ...
0 votes
0 answers
13 views

Prevent random entries in hierarchical false taxonomies

I registered a custom taxonomy with the register_taxonomy function, and set it as non-hierarchical, to get the autosuggest input field instead of checkboxes. But, users now can add any random entry, ...
  • 186
0 votes
0 answers
17 views

Rewrite Rule for custom post type link with or without taxonomy terms

I tried to find the solution for a custom post-type URL rewrite with or without taxonomy terms but I can't find the proper solution because I have some odd requirements. The following code is working ...
0 votes
0 answers
38 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 ...
  • 61
0 votes
1 answer
38 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', '...
  • 186
0 votes
0 answers
25 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 ...
0 votes
0 answers
39 views

How to add to taxonomies to a post type

I have sucessefuly add a second taxonomy called tagcat" to a custom post type called "information", add_action ('init','create_information_eventcat_taxonomy','0'); function ...
1 vote
1 answer
41 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('...
  • 185
0 votes
0 answers
34 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 ...
  • 3
1 vote
0 answers
22 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, ...
  • 11
0 votes
1 answer
101 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 ...
0 votes
0 answers
65 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, ...
0 votes
1 answer
53 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 ...
  • 111
1 vote
1 answer
47 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 ...
  • 23
0 votes
0 answers
11 views

Pagination links not working for custom taxonomy

I have a Custom Post Type (project) and a Custom Taxonomy (project_category). I have created a Page (Projects), which uses a custom template, in which I run a WP_Query to fetch projects and display ...
  • 165
0 votes
1 answer
56 views

Custom taxonomy archive empty

I have created a custom post type with the following arguments: $args = [ 'label' => 'Projects', 'labels' => $labels, 'description' ...
  • 191
0 votes
1 answer
25 views

Url rewrite with custom post type and taxonomy

Here is what I am looking for: Custom Post Type: partner Archive: domain.com/partners/ (list all partners) Custom Taxonomy: country Archive: domain.com/partners/denmark/ (list all partners in a ...
0 votes
0 answers
26 views

Filtering custom post types using category taxonomy

I have implemented a custom post type called "Portfolio" and I have included the taxonomy: category with 3 categories: Category1, Category2 & Category3 I have created a filter form to ...
0 votes
0 answers
12 views

Taxonomy to display form after creation

I'm just trying to create something very custom, and I have not found any tutorials that have done this. I have created a custom post type and taxonomy. The custom post type is named Housing and the ...
  • 111
0 votes
0 answers
20 views

Custom Post Type with multiple Custom Taxonomies / Hide Taxonomy Slug from URL

I have a Custom Post Type with 4 Custom Taxonomies. Everything is working great about this part. But, right now my taxonomies pages URL are: website.com/taxnomy/taxonomy-item I would like to have: ...
0 votes
0 answers
13 views

How home my code doesn't display any feature image? Looping through post from a taxonomy and not getting feature images back

The only thing I am trying to do is just to display each post from Services that belongs to the taxonomy called 'national' and display its title and its featured image. So far it displays each title ...
0 votes
1 answer
311 views

Query posts by custom taxonomy slug in WP REST API?

I'm trying to do the above-mentioned; and came across this and this. Is it still the case that you have to query by term ID using the REST API, and there's no built-in way to query posts via the WP ...
  • 421
0 votes
0 answers
14 views

How can I change the URL via add_rewrite_rule()

As from a link of the form: http://testsite/city/sochi/?listing_type=apartment I can get http://testsite/city/sochi/apartment The method provided below does not work for me, what is my mistake? ...
0 votes
0 answers
35 views

Different CPT permalink base on taxonomy

I hope someone can help as I has spent few days to sort out but can't, this is expecting the permalink with category 'services' will structure to /products/services/[product-title] and the rest of the ...
  • 11
0 votes
0 answers
36 views

How to combine taxonomies into URL?

There are two taxonomies on the listing_city and listing_type website. Within which there are headings(cities in the first, types of apartments in the other). The url logic in taxonomies is as follows:...
0 votes
0 answers
27 views

How do I ensure that post_type and Taxonomy use the same slug?

I had to create a Custom Post Type and taxonomy to add a question and answer section to my site. But I want both of them to use the same persistent link. The codes are like this, so one of the two ...
0 votes
0 answers
12 views

Why do my quick edits for custom taxonomies not show on the post frontend?

So I have created a couple of custom taxonomies and to save time I used the quick edit to apply taxonomy terms to posts. The problem is these changes don't show on the frontend. When I go in to edit ...
0 votes
0 answers
22 views

Filter with two id of the same value CPT UI(taxanomies)

I have a special link with a filter, so I filter things with slugs through the link, for example mydomain.com/filter/?technology=angular&category=software-development and it shows the chosen jobs ...
0 votes
0 answers
29 views

Custom post type page with parameter

I'm building an educational website with Wordpress and Elementor Pro. I programmed a plugin that programmatically creates a custom post type. public static function new_cpt_course() { $...
0 votes
0 answers
13 views

add_filter get array data before display in custom post_type

I have custom "register_post_type" before display data I want to process some data. I cannot found out how to get to data like add_action('the_post', 'my_function') Problem that I have is ...

1
2
3 4 5
89