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
1answer
6 views

Keeping session instance of random display results over pagination breaks

I'm working on a site that has blog posts with performers' info under a single category that can be filtered using a custom taxonomy (both parent and child terms). To keep it as fair as possible, the ...
0
votes
1answer
19 views

Change dynamically the dropdown list value

I have a form where i list a related custom post type by ID of the parent custom post type on a checkbox list like the picture. so when i check an option to 4 options i want to have a list of the ...
0
votes
0answers
11 views

when custom taxonomy is empty, the page won't load

I'm developing a woocommerce theme and I added "brands" custom taxonomy to products. It's working when the user chooses a brand for the product but when we don't choose any brands, the page ...
1
vote
2answers
24 views

Load a certain functions file for a certain taxonomy

I have split up all my functions into separate files and load these from the functions.php using the below: require get_template_directory() . '/inc/bhh-functions/scripts-styles.php'; require ...
0
votes
0answers
20 views

Problems using get_the_terms in a plugin

I'm attemting to craft a small plugin to get_the_terms from a custom taxonomy for a custom post type. The code below is causing a critical error, but I'm in the dark on why. if ( ! defined( 'ABSPATH' )...
0
votes
0answers
15 views

Change list of term by choice of custom post (logical condition on form)

I made a script that lists me in the posts that are of a type related to another type of content. This I do on a form. What I want to do is: If I choose the type of post (custom1 = formation) in a ...
0
votes
1answer
35 views

Why are custom taxonomies only appearing on the edit page of one of these types, but not the other?

So here's an odd one. I have custom taxonomies that show on the admin menu of both post types they're associated with, but only one of the post types shows them in its edit menu. (Over on the side of ...
0
votes
1answer
50 views

Get terms of a post but only if they're also the child of a specific term

I have the below code successfully running on my custom post type archive pages. The only issue I have is that I want the list of 'book_cat' taxonomy terms for that post but ONLY if they're also ...
0
votes
1answer
23 views

Targeting custom post type via functions.php doesn't work

I have a custom post type, books, set up and a custom taxonomy, book_cat, to act as categories for these posts. I've added the below code to functions.php to sort posts on my custom taxonomy archive ...
0
votes
0answers
19 views

List hierarchy of taxonomies related to posts from current query

I have a custom post type that has two taxonomies related to it. Think a Post of "Equipment" and taxonomies of "Manufacturer" and "region". Region is a hierarchy and a ...
1
vote
0answers
23 views

Custom Taxonomy terms aren't getting referenced or saved in Quick Edit or Bulk Edit, only on Single product page?

I am using Woocommerce, Elementor, ACF Custom Fields and CPT for Custom Post types. I have a custom taxonomy called 'biographies' which has some associated custom fields (first name, last name, birth ...
0
votes
0answers
6 views

Issue with permalink for CPT and Custom Taxonomy

I'm working on a website with a number of custom post types and custom taxonomies. I've setup a CPT named service with a custom taxonomy named servicecategory. The URL for my service posts look like ...
0
votes
0answers
40 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 ...
0
votes
0answers
8 views

How to allow users to add a custom item to a taxonomy other than an admin in a custom post type?

The first picture is a picture of a taxonomy in a custom post type logged in with the role of an admin. The second picture is a picture of a taxonomy shown in a custom post type logged in as another ...
0
votes
1answer
18 views

How to add a shortcode function that returns the taxonomy slug of the actual post within the loop

Circumstances: I have a CPT called "designs" and a taxonomy related to it, called "project_category" so that I can assign a category to each design. I'm building the template for ...
0
votes
1answer
11 views

get term id from term name

Hi i am trying to get term id from term name (title ). <?php if ($_SERVER["REQUEST_METHOD"] == "GET") { // collect value of input field $nameb = $_GET['fname2'...
0
votes
1answer
35 views

Add taxonomy column with meta field (ACF) content

Trying to populate the column with meta field, this way (ACF): add_filter('manage_artist_custom_column', function ($content,$column_name,$term_id){ $term= get_term($term_id, 'artist'); switch (...
0
votes
0answers
16 views

Custom widget for category filter with custom post types

I'm trying to create a widget for my sidebar that allows readers to filter for both the regular blog categories and for the categories of my custom post types. What I have come up with so far gives me ...
2
votes
1answer
22 views

Auto add taxonomy if post has category

First off this is my first time posting on here. I can usually do research and put together code that I need based off of other's responses, but I'm stumped on this one. I've been at this for almost a ...
0
votes
0answers
8 views

Associate custom field with custom taxonomy with shortcode in backend

I am trying to associate a custom field to a custom taxonomy booked_custom_calendar. Custom field here is [notifications_user_id]. All this will be executed using a shortcode. When user clicks on ...
0
votes
0answers
10 views

Custom search results page template

My custom search form searches for posts in two custom post types by selected taxonomy. Search results are displayed on blogposts page (index.php template) and I need to display results on custom page....
1
vote
1answer
21 views

Fetch taxonomies by custom post type id array

I want to find all the taxonomies that match an array of CPT id's. I have a taxonomy called location and I want to find all the locations where they have posts that are equal to my array of post id's ...
0
votes
0answers
21 views

Warning: Undefined variable $post in C:\xampp\htdocs\… after PHP upgrade

I use localhost for testing and debugging sites, before making changes to the live site. Because MySQL failed in XAMPP, I had to install XAMPP from scratch. I'm now using PHP version 8.0.3. ...
0
votes
1answer
20 views

Archive page for taxonomy terms

How can I create a archive over terms from a custom taxonomy like there is for custom post types? domain.com/taxonomy is empty/404, while domain.com/cpt shows all posts for that CPT. I know I could ...
0
votes
0answers
10 views

Taxonomy page not working

I have a custom post type called topics, with two custom taxonomies: topicscat and tagscat. The taxonomy page of tagscat is returning 404 error. I guess Im not registering it right. Here is my code. &...
0
votes
1answer
14 views

Search CPT by tag ids

I need to search custom post type by tagids. I have created a post type that is "gampu". In this post type i have register 5 tags taxonomy like 'fitting', 'adapter', 'type', 'volume' and '...
1
vote
1answer
21 views

Custom Taxonomy in REST API

I have two custom taxonomies that I use for my posts. I am trying to retrieve the names from only one of them. In REST API V2, I do the following: https://example.com/wp-json/wp/v2/posts/14340/?_embed=...
0
votes
1answer
24 views

Error 404 change permalink term custom term taxonomy

I'm trying to change the permalink structure of the terms for a custom taxonomy, but it's returning page 404. I want the URL to be: example.com/products/category/category-name. I tried to use the ...
0
votes
0answers
7 views

Custom post type 404 category page

I created a custom post type called news and a taxonomy for the custom post type called news categories. However, the category page archive returns me 404. **Register Custom Post Type** $...
0
votes
0answers
11 views

Pagination on taxonomy template not working after rewriting slugs

My pagination is not working on my taxonomy(sub-category) page. It keeps on loading my archive template. This happened after I applied function codes that re-write's url and producing all parent and ...
0
votes
0answers
12 views

Filter taxonomy terms by custom ACF field in admin area

How do I add a custom filter to a taxonomy in the admin view (/edit-tags.php), and how do I use a ACF field as what to filter by? I know that you can add a filter to the post list view with the hook/...
0
votes
0answers
9 views

Filter taxonomy archive by a different taxonomy's terms

I have TAXONOMY A and TAXONOMY B (used with Pages and 2 custom post types). I need the taxonomy.php template used by TAX A to filter by the terms of TAX B. What's worse, I need to be able to use an ...
0
votes
0answers
8 views

How to set a limit of a taxonomy term

I am seeking to allow an admin being able to set a varying limit of users who can be added to each user taxonomy term. The user taxonomy term is selected when adding a new user from the user edit page ...
0
votes
0answers
19 views

How to display taxonomy terms in a dropdown on a user edit page

team. I used a snippet from online to create a user taxonomy that displays the list of the taxonomy terms as a checkbox format. However, I want to display the terms in a dropdown style and must be ...
0
votes
0answers
8 views

Query post by one taxonomy and sort by another

I am getting the posts by a custom taxonomy called "wall_of_fame". This gets me all the posts that match "Yes" in this custom taxonomy. $query_args = array( 'post_type' => '...
0
votes
1answer
12 views

Display post count for a specific month

I am trying to display post count for a specific month, But something is wrong with my query because count is wrong. here I want to get post count for Aprel month. Can anyone help me please ? Thanks ...
0
votes
0answers
5 views

How to force display of subcategories in an archive file on custom urls

I implemented custom urls in my cpt and custom taxonomy. My url in single page this "mysite.com/custom-post-type-name/category/subcategory/single-post-name/". I would like to show in url &...
0
votes
1answer
13 views

Get dropdown child categories from parent category of custom post type

Finally i cant get subcategories from a custom post type category and everything works fine. The problem is when i want get the same but with a dropdown for responsive. Is possible? i need hide empty ...
0
votes
0answers
9 views

Display 1 custom post type by a custom taxonomy not working

So the idea here is I have multiple products (CPT) and a custom taxonomy named Feature. It's a radio button field with Yes/No option. I want to display 1 random featured product on front page. But ...
0
votes
0answers
10 views

Check if terms in custom taxonomy has children and not show

I have a problem. I would like to show terms in custom taxonomy wchich have children. My code: $terms = get_the_terms($post->ID, 'kategorie_dladomu'); if ( $terms && ! ...
0
votes
0answers
8 views

Count for Media Library Attachments specified by Categories

I've added this function into my function.php file that allows me to specify images in my media library with categories. /* Add Categories for Media Library Attachments /*------------------------------...
0
votes
1answer
31 views

sort CPT on Custom Taxonomy Archive page

I have created a custom post type called "al_product" and attached to it a custom taxonomy called "product_category". In my archive-product_category.php I have this (relevant) code:...
0
votes
0answers
13 views

Custom Post Type with Custom Taxonomy and Permalink rewrite 404 issues

I am trying to set up a custom post type with a custom taxonomy applied with proper URL structure. What is working is website.local/demosite/products/technology/product-1/ this is showing correctly. ...
0
votes
2answers
23 views

WP custom posts: filter results to custom taxonomy tag that corresponds to user meta field

I need some guidance on making a wordpress posts query responsive to user meta data, and whether it’s possible to do what I want within the query itself, or if further work is needed in the database ...
0
votes
0answers
19 views

404 page for post site with custom post type

I am stuck on a problem with a custom post type and own taxonomy. The archive pages are displayed correct. So: page.com/videotraining/ <- working page.com/videotraining/'cpt-title'/ <- working ...
0
votes
0answers
16 views

Adding custom taxonomy to DEFAULT post permalink structure

I'm trying to use the default post type for news-like articles on my site, but want to modify the post permalink structure to include a custom taxonomy. I'm currently using the default category ...
1
vote
1answer
14 views

Why my filterable portfolio page work not perfectly between slug button and slug output WORDRPESS?

I currently have a Portfolio custom page in Wordpress, so far work as i want, but i have one problem. The problem is when i click one of the button slug then the body/output is not work like i want, ...
0
votes
0answers
8 views

How to add search to custom taxonomy boxes in non-gutenberg editor

I am using the latest version of WordPress (5.7) and have created a custom post type with custom taxonomies. I do not have the Gutenberg editor activated for the post type, so I do not have search for ...
0
votes
1answer
30 views

Display custom post types in dropdown with option “all”

wp_dropdown_categories() function has an argument show_option_all to search in all terms if selected. I need something similar in my custom post type select: <form method="GET" action=&...
1
vote
0answers
21 views

How to limit the number of users who can be added to a user custom taxonomy?

I have created a user custom taxonomy called institutions and when an administrator/NationalCouncil role is creating a user account, he or she should be able to allocate that user to one institution. ...

1
2 3 4 5
85