Questions tagged [taxonomy]
A taxonomy is a generic "category" used to organize posts and custom post types
1,980
questions
0
votes
0
answers
8
views
Inherit value from ACF parent post [closed]
Is it possible to inherit a value from ACF in the parent post.
Example, I am having CPT called 'Locations', and I got it like this:
New York (parent)
Brooklyn (child)
Queens (child)
I have a field ...
-1
votes
0
answers
14
views
How to delete unused terms?
I need some help. I have some terms to delete for better performance, but I don't know how to do it.
What can I do to solve this problem? Thanks in advanced!
0
votes
0
answers
15
views
Remove colon from CTP UI "Singular Label"
How can the colon be removed or changed from the Custom Post Type UI/Taxonomies/Singular Label? This colon shows up in my page title in Wordpress and looks like this "Recipes for: Dinner".
...
1
vote
0
answers
11
views
How to add an ACF only for parent term?
the question here is not for the front-end, it is for the back-end. Is there any way that I can add a custom field using ACF that only displays/shows in parent term.
└── Category
├── Motherboard &...
1
vote
0
answers
25
views
custom taxonomy not return in the code
i tried to add custom taxonomy to custom post type named "project".
this is my code:
function create_project_taxonomy() {
register_taxonomy(
'project_cat',
'...
0
votes
0
answers
19
views
Failed to update a post when I add a taxonomy to it
I have a custom post type that has taxonomies added and when I mark a taxonomy in the block editor it does not update the post, and it automatically unmarks the marked taxonomy not allowing me to add ...
3
votes
1
answer
50
views
How can I get taxonomy term name using term slug & post ID using build in WordPress function or class?
I have the following SQL query:
SELECT t.name FROM wp_posts p
INNER JOIN wp_term_relationships tr ON tr.object_id = p.id
INNER JOIN wp_terms t ON tr.term_taxonomy_id = t.term_id
WHERE p.id ...
4
votes
1
answer
38
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 ...
0
votes
1
answer
37
views
'Unsupported Operand Types' error stemming from taxonomy re-writes with PHP 8.1
I was getting a FATAL ERROR in WordPress, but only on the front end. I KNOW the error is within my plugin, but the stack trace returns info about WP Core files, and doesn't identify where in my ...
0
votes
0
answers
12
views
Is it possible for post and custom post type to share a category base slug?
so I'm wondering if it is possible, could POST (base category) and CUSTOM POST TYPE (base category) share the same slug? Could you let me know what am I doing wrong?
In fact I actually did it, both ...
0
votes
0
answers
18
views
Add custom fields to Woocommerce Category Page
I want to add custom fields to Category Woocommerce items (page-products-cat);
I have tried using this code but It does not work :
add_action(‘product_cat_edit_form_fields’, ‘...
0
votes
0
answers
30
views
Custom Titles for Multiple Tag Taxonomy Page
Let me explain what I want to achieve.
Normally WordPress allows "filtering" tags with multiple tags. It goes like this:
https://example.com/tag/tag1+tag2
It's useful when tag1 has a lot of ...
0
votes
0
answers
12
views
Hiding a tag from display
I kind of dug myself into a hole. My client has three discrete blogs. We'll call them A, B and C. I did this using categories because they all have to appear together chronologically on a generic blog ...
0
votes
1
answer
50
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
84
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. ...
0
votes
0
answers
14
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
0
answers
12
views
Is there a way of displaying related posts from lowest hyrachical order (lowest child category to parent category)
Here is my code, currently when viewing a post it ends displaying posts from second child category(second in hyracichal while we have 4 stages). I want it to display posts from 4th child category, if ...
0
votes
0
answers
14
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 ...
0
votes
1
answer
85
views
cannot create product attribute (taxonomy) and add terms on the same execution
I have the following functions to create a global product attribute and populate it with terms based on data from an API.
protected function getOrCreateAttribute($slug, $name)
{
$...
0
votes
1
answer
22
views
get_terms of specific parent (including the parent itself)
The title is self-explanatory, but let me say a word on this...
I want to get the terms of a specific parent, but also include the parent itself in the returned terms. I tried something this $args['...
0
votes
0
answers
9
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
0
answers
15
views
is there a hook filter to get custom fields for taxonomy name instead of the default field?
For example, a multi-language site.
I have 2 ACF fields for the taxonomy title. One for the Chinese site and the other one for the English site. So when visitor switches the site languages. The ...
0
votes
0
answers
16
views
Custom taxonomy with page post type - Wordpress
I need to add custom taxonomy before every page name, similar to polylang or wpml. I can add text to link but i have 404:
function lang_pages_permalink( $permalink_structure, $page_id ) {
if ( ...
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, ...
0
votes
0
answers
36
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 ...
0
votes
3
answers
121
views
How to orderby Taxonomy Term in a WP Query
I have been told here that having my data saved as metadata is creating slow queries.
I'm starting to convert all data used to sort my posts to taxonomy data. I've converted all the data stored in '...
0
votes
0
answers
22
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
37
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 ...
0
votes
2
answers
76
views
Not recognizing my custom templates in hierarchy
I created a custom taxonomies to work like category called projects to be used for the attachments.
I want to be able to create the archive page without having to use the CMS.
Currently the only thing ...
0
votes
1
answer
18
views
Images as Categories
I've searched everywhere for a way to do what I'm thinking, I'm really sorry if this was answered already.
So, I want to change the Category text/ name for an image/icon in the blog page.
Let me try ...
0
votes
0
answers
33
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 ...
0
votes
2
answers
28
views
Unable to do WP_User_Query with meta filter
I have a user base of hundreds of users, and trying to create a custom API endpoint to get users in a specific membership group.
The database structure is as follows (using Ultimate Member plugin):
...
0
votes
1
answer
35
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
...
0
votes
0
answers
18
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
18
views
Create taxonomy terms from custom field values
I have a CPT 'Candidates', where its custom fields are being fetch from an API.
I am planning to convert/associate the values of these custom fields as taxonomy terms. Because I need to filter the '...
0
votes
0
answers
31
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
10
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
1
answer
51
views
Amend taxonomy to search in wordpress admin
I am trying to amend a custom taxonomy to a search in the editor area.
The taxonomy slug is 'help_cat' and is attached to 'help-center' post types.
What I am trying to achieve is very similar with OP ...
0
votes
1
answer
24
views
Order Categories by Character Count
I'm developing a medical directory website in Wordpress, and in the Grid/List pages for the site, each of the listing cards contains a list of specialties (using the category taxonomy within the ...
0
votes
0
answers
31
views
Include get_term_link inside search
I am trying to include custom taxonomy links inside the search.
This is my code that gets the links of my 'help_cat' taxonomy, but I am struggling on how to add/include this inside the search.
...
0
votes
1
answer
34
views
Adding new terms to custom taxonomy
I created categories for attachments with register_taxonomy like so :
function simple_register_attachments_tax()
{
register_taxonomy(
'gallery-category',
'attachment',
array(
'labels'...
0
votes
0
answers
216
views
Display ACF category image on archive and single template files
I have written this function to display an Advanced Custom Fields image custom field added to a specific category (News) in WordPress. This image displays on the category archive page and all of the ...
0
votes
1
answer
88
views
How to add/enqueue Custom CSS for a custom taxonomy page?
So this is what I have done for my homepage so I load css that only loads on my homepage
function enqueue_frontend_assets(){
if(is_page_template( 'homepage.php')) {
wp_enqueue_style( '...
0
votes
0
answers
58
views
"Menu order" being ignored when querying posts from a parent taxonomy with "include_children" set to true
I have a CPT of articles and a custom taxonomy of collection. This is how the articles are assigned to the collections:
Collection 1
Article 1 (menu_order = 1)
Article 2 (menu_order = 2)
Sub ...
0
votes
0
answers
64
views
get_the_category - display only a single category for a post (not all categories)
I am trying to display only one post category for a post, instead of them all. My current code is:
<?php
$category = get_the_category($post_id);
foreach($category as $cat){
if ( $...
0
votes
0
answers
99
views
Get URLs for AJAX Filter Checkboxes WordPress
I have a problem with showing and generating URLs for the pre-checked filter. So basically I need links for a specific filter, for example, I'm choosing the Location, the Salary, the Type of Work and ...
0
votes
2
answers
60
views
What is the purpose of the "term_id" column in the "wp_term_taxonomy" table?
The table below shows some example rows from a "wp_term_taxonomy" database table. Notice that values of the "term_taxonomy_id" and "term_id" columns are exactly the same. ...
0
votes
0
answers
24
views
Unique taxonomy for post
I want to have the possibility to select only one taxonomy per post and not multiple taxonomies ; I have found this article about this, but I found it a little bit complicated.
https://sudarmuthu.com/...
0
votes
0
answers
60
views
WordPress Conditional / Multiple Taxonomy Query
I am trying to create a custom WordPress taxonomy query with multiple but conditional statements. However I am having issues when more than one taxonomy query is added to the statement.
$tax_query = ...
0
votes
0
answers
49
views
get_the_terms has strange result since version 6.0
Since version 6.0 of WordPress some of my code with get_the_terms() doesn't work as expected in several sites where I use custom query loops.
For example I have this loop where I want to get the ...