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
0 answers
4 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 ...
user avatar
0 votes
1 answer
14 views

wp_set_post_terms doesn't allow to manually add new terms [closed]

So I'm creating a function which based on the selected category for the post, it automatically adds terms (tags alike) to that post. It works fine, the problem is now the post has those terms and if I ...
user avatar
0 votes
1 answer
16 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( '...
user avatar
0 votes
0 answers
16 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 ...
user avatar
0 votes
0 answers
26 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 ( $...
user avatar
0 votes
0 answers
23 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 ...
user avatar
0 votes
2 answers
54 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. ...
user avatar
  • 103
0 votes
0 answers
13 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/...
user avatar
0 votes
0 answers
16 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 = ...
user avatar
  • 1
0 votes
0 answers
31 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 ...
user avatar
0 votes
1 answer
30 views

display category with background color

i'm new in the wordpress developpment. i started coding my first theme and i want to dispay categories with color, each category has his own color. in wordpress i know that we have : category name - ...
user avatar
0 votes
0 answers
18 views

How to associate a custom taxonomy to a post multiple times

On my Posts, I'm trying to associate a custom taxonomy to it multiple times. The example is that I have a User taxonomy and a Post which is like an event. I want to be able to associate the User ...
user avatar
  • 1
0 votes
1 answer
40 views

Can't get term id for category archive

I am trying to get the term_id of the current category archive. On the category archive, when I var_dump($wp_query) object(WP_Query)#1189 (55) { ["query"]=> NULL ["query_vars&...
user avatar
  • 307
0 votes
0 answers
28 views

Can I use the 'category' taxonomy for both posts and a custom post type?

Is there a disadvantage or issue with using the category taxonomy that post uses with a custom post type? For example: $args = array( 'label' => __( 'Item', 'text_domain' ), ...
user avatar
  • 307
0 votes
0 answers
34 views

Exclude taxonomy term from list of current taxonomy terms

I am trying to display a list of custom taxonomy terms for the current page, but do not know how to filter out specific terms. My code is below. How do I exclude certain taxonomy terms? I'm still ...
user avatar
0 votes
1 answer
27 views

Trash Bin for Categories?

I have a cat_notice taxonomy, where there are several categories and one of them the slug is 'trash'. In this case I created a link and I needed that when I clicked on this link I would take the ...
user avatar
0 votes
0 answers
15 views

How to make a post with certain taxonomy term display first before other post with only one query?

I have a custom post types Courses that I want to display on my page but I want to display courses with custom taxonomy term called 'math' and then all the other subjects after that. I'm able to do so ...
user avatar
0 votes
0 answers
16 views

Hi need update in my terms for other taxonomy

I'm new to wordpress, and in this case I created 2 taxonomies, cat_notice and trash_notice, what I need to do is when I delete a term, instead of it being deleted, it is reinserted in another taxonomy ...
user avatar
0 votes
0 answers
9 views

Duplicate menu items when auto generating menu from product categories

I have been searching for solutions for a problem that many have in Wordpress. I wanted to create a menu that automatically adds children and grand children of product categories that are already in ...
user avatar
0 votes
0 answers
8 views

How to embed the Taxonomy Admin screen in to a Tab of a Settings Page in a plugin

I am building a Plugin which has a number of custom post types and some associated taxonomies. What I am trying to do is to embed the edit-tags screen for specific taxonomies in the Settings Tab of my ...
user avatar
  • 11
0 votes
1 answer
18 views

update_term_meta not working

I am trying to remove a string off of a bunch of slugs in terms from a CPT taxonomy. For example, I have a term named "Accounting" but the slug has the "accounting-expert-witnesses"...
user avatar
0 votes
0 answers
37 views

How to get post count of specific taxonomy that have store name & category

I am new in php and trying to learning php. I have taxonomy called dealstore. I have added one store name "Amazon" and two categories name "coupons and electronics". Now, I want to ...
user avatar
  • 1
0 votes
0 answers
16 views

how to create hierachial taxonomy and manage under single post type?

i have created Farmers Post type for managing farmers data in wordpress. now i want to create hierarchical taxonomy as below: ->state ->district ->g.panchayat ->village ->farmers Please ...
user avatar
0 votes
0 answers
16 views

Tags hierarchical

I changed the default code in the wp-includes/taxonomy.php file to: register_taxonomy( 'post_tag', 'post', array( '...
user avatar
  • 101
0 votes
0 answers
67 views

How to display the post categories for each post inside the loop with custom format?

I'm trying to create a shortcode to display the post categories with custom format (ex.: I need to display emoji acf field before each category). I'm using version 6.0 of WordPress and the Full Site ...
user avatar
0 votes
1 answer
20 views

Wordpress bulk category select when publishing post

Often I need to attach post to all categories and I have about 200 categories. When I need to select all categories while publishing post , I select categories one by one. How can I add select all ...
user avatar
0 votes
1 answer
24 views

A function to add arguments to a taxonomy

I use a plugin that adds the taxonomy "Vendors" - but not with arguments I need to be able to use a layout designer (Avada-> Layouts) and assign that layout to all "vendors" I ...
user avatar
  • 63
0 votes
1 answer
8 views

Display List of All Taxomony Terms of A Post

I have created a Taxonomy named “Genre”. In one of my posts, I added the following categories to its “Genre” Funny Action Adventure How can I display Funny, Action, and Adventure under the title of ...
user avatar
0 votes
1 answer
17 views

Menu for taxonomies and posts belongs to taxonomy

I am currently looking for a solution to the following problem: I have a Custom Post Type named "docs" and for it a taxonomy "docs_category". Note: The taxonomy is hierarchical. I ...
user avatar
0 votes
0 answers
12 views

Exclude taxonomy Query if post_type

How can I define in pre_get_posts hook on custom post type to not execute the query on a taxonomy. I have the following if (!empty($newsType) && $newsType == 'press') { //if $newsType ...
user avatar
  • 824
0 votes
0 answers
7 views

Customize menu link for taxonomy in WP menu

I have a Taxonomy that I would like to change the link to in the WP menu. When clicking it goes to the Add Taxonomy page, like normal. What I would like to do is navigate to the Edit Page. In other ...
user avatar
0 votes
0 answers
10 views

How to change the author box selection on a post to a custom taxonomy

So instead of the author section pulling in 'Users', I need to change it so that the author box displays a selection of the terms from a custom taxonomy I have made. Is this possible to change?
user avatar
0 votes
0 answers
25 views

How to automatically create a terms based on each post of a post type

I am working on a music site which has custom post types- artists, and releases. I have about 3,000 artists, and about 19,000 releases in my database. I'd like to create a new taxonomy term for each ...
user avatar
0 votes
1 answer
65 views

How to add custom meta to 'pre_get_terms'?

I have a custom taxonomy with custom meta. I have added the custom meta values to columns in the admin list page just fine. But if I search for values that are in these columns nothing is found. I'm ...
user avatar
  • 281
0 votes
0 answers
38 views

WordPress: Export/Import Yoast meta title & description to custom taxonomy

I want to export the Yoast meta title & description from a custom taxonomy with the WP All Export. Unfortunately there is no direct way with the plugin to do that. There is an extra WP All Export ...
user avatar
  • 145
0 votes
0 answers
40 views

WP query taxonomy optimization

Is there any way to speed this query? Noob here. SELECT wp_posts.ID FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) WHERE 1=1 AND (...
user avatar
1 vote
0 answers
24 views

Choose whether to automatically add a taxonomy with the same name as the post

I created a custom taxonomy within the blog post. It's called "FootNotes." I would like there to be a checkmark inside in the creation of the post that asks me "Are there any notes ...
user avatar
0 votes
0 answers
23 views

WordPress how to prevent URL encoding in URL of taxonomy terms

Is it possible to prevent WordPress from encoding URL with terms? I have a sample taxonomy term "iPhone5~iPhone7" and when I use it for the search function, it turns to "iphone5%ef%bd%...
user avatar
0 votes
0 answers
24 views

Get ACF taxonomy term and sub-term lists ACF blocks

I want to get list of parents and child terms from ACF field type Taxonomy. This things need to display as ACF blocks. i have tried many things to done this stuffs but but it's not working for me. ...
user avatar
0 votes
1 answer
25 views

Custom Post Types not queried in Custom Taxonomy archives or Native archives

I have declared a selection of custom post types as an array, allowing post_tags but not categories: // Add Multiple Custom Post Types add_action('init', 'all_custom_post_types'); function ...
user avatar
  • 29
0 votes
1 answer
35 views

Category post count is not correct

When I go to Posts > Categories, some categories show that they have a post. See screenshot. But there are no posts linked to that category. When you click on that "1"-number, no posts ...
user avatar
  • 125
0 votes
1 answer
15 views

WP_Query, Taxonomy, list of attached items to a Term, sorted

I have a Taxonomy, “Genre”. “Genre” has a Term, “advert”. I want my taxomomy template to grab all Custom Posts attached to that term, sort them by my last_name, first_name, short_title Custom Fields, ...
user avatar
0 votes
1 answer
19 views

Get List of Terms based on a given term (different taxonomy)

I have two taxonomy and a post type. Post type: Employee (employee) Taxonomy: Location (term example chicago, id 1) Taxonomy: Job Title (job-title) I want to list all job title based on a ...
user avatar
  • 7,625
0 votes
0 answers
10 views

Disable Category Taxonomy

There's a similar question to this posted back in 2013 (Completely disable categories), but the proposed solution doesn't provide information as to how to implement it (where do I place the provided ...
user avatar
0 votes
0 answers
18 views

CPT archive with WP native/core tax/categories

So for some reason this is oddly difficult. I need to have a CPT which uses the core categories between the CPT reviews and core posts as news. I've tried getting the CPT archives as just URL which is ...
user avatar
  • 67
0 votes
1 answer
24 views

Get Comma Seperated Taxonomy Linked Terms and Last Child Separated By "&" Instead Of Comma

I Want to List Custom Taxonomy Terms with Link and Separate Each with Comma but add "&" before the last term. Example: Drake, Migos, Ciara & Nicki I found this answer that shows ...
user avatar
0 votes
0 answers
33 views

Exclude post with taxonomy and from the terms (taxonomy & tag) posts count

Using the below code, i have excluded the taxonomy (slug:expired) from archive or tag or taxonomies pages in front-end. add_action('pre_get_posts','custom_get_posts'); function custom_get_posts($query)...
user avatar
  • 13
0 votes
0 answers
13 views

Duplicate slug/permalink issue while adding same post name

I have my permalink format set to /%taxonomy%/%postname%/ and I have books custom post type with Genre as a custom taxonomy. But the main problem is it is not allowing to add the same post name http://...
user avatar
  • 21
0 votes
0 answers
12 views

Page that lists publications by classifying them by taxonomy

I need a little help writing code. I have an "artists" CPT I have an archive-artists.php page with the code below, but I would need to add a "year" taxonomy. And that my artist ...
user avatar
0 votes
2 answers
23 views

How to makes changes on the shop/category/tag pages but not on the product pages in woocommerce?

I've recently added a plugin to have product filters (BeRocket) on my wordpress/woocommerce website. To display those filters on the page I made a widget and added it in my woocommerce.php page. It's ...
user avatar
  • 1

1
2 3 4 5
40