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.
4,460
questions
0
votes
0
answers
3
views
How to Bulk Update CPT Taxonomy Values Using CSV Lookup Table
I have a CPT named Places on a very large website with a few million posts. Each post has a value for the taxonomy States (e.g, FL). Normally I use WP All Import, but it's very slow. Processes about ...
0
votes
1
answer
2k
views
Remove custom post type slug but keep related category taxonomy permalink
struggling as well with custom url rewriting for custom post type taxonomies.
Here is my requirement:
domain/mycpt_category/postname/
It's well documented here and in several SE threads removing ...
1
vote
1
answer
888
views
Custom Taxonomies not retaining hierarchy while importing from one site to another
On my site I have a Custom Post Type "listing" which has a hierarchial Taxonomy "local".
The terms in this taxonomy are in the form of States > Cities.
For example "Washington" is a parent term &...
0
votes
1
answer
1k
views
tax_query showing no results
I'm creating a music database site with two custom post types: tracks and albums. I've linked the tracks to their respective albums with a custom taxonomy for the album's slug. On each album page, I'm ...
0
votes
1
answer
2k
views
Add active class to foundation 6 tabs while looping categories
I have a custom post type (bulletins) that I'm putting into Foundation 6.4.3's tabs and accordions. The taxonomies are the tab headings. The individual custom post type content is the accordions.
My ...
28
votes
5
answers
152k
views
get_posts assigned to a specific custom taxonomy term, and not the term's children
Say I have the following taxonomy terms:
Term 1
Term 1.1
Term 1.2
Term 2
Term 2.1
How can I get only posts that are assigned to Term 1 and not include those that are assigned to Term 1.1 or ...
0
votes
1
answer
1k
views
How to display only taxonomies of custom post type in a page?
I have created recipe as a custom post and types as a taxonomy.
In that taxonomy I have created vegetables and fruits as fields and I have 5 posts in each fields, but I need to display only vegetables ...
0
votes
1
answer
2k
views
Group posts in a category based on tags in custom taxonomy
I had my built-in posts set up with categories and tags. I created a template that would display posts of the category that matched the page slug.
then it would group them by the Tags. for example, ...
5
votes
1
answer
4k
views
I want to load post content by categories using Ajax
I have question.
I would like to load post content, custom post, depends on category.
So first of all I would like to have drop down menu which will list all my categories then once user will select ...
1
vote
1
answer
1k
views
Some custom taxonomy child terms not showing in admin. Caching problem?
I have a problem with some custom taxonomy terms. I am using "Types" plugin for creating custom post types and custom taxonomies.
I successfully created my postype and hierarchical taxonomy and ...
0
votes
3
answers
3k
views
link posts to custom post type
I have a custom post type 'books' which I store different custom fields of information about books.
I want to use posts and link the posts I write (in categories such as news, or offers) to the books....
33
votes
8
answers
156k
views
How to Add Custom Fields to a Custom Post Type?
Ok, so I have registered a few custom post types and a few taxonomies. Now, for the life of me, I cannot figure out the code I need to add a Custom Field to my Custom Post Type.
I need a drop down ...
3
votes
1
answer
1k
views
Get list of terms of current taxonomy archive for another taxonomy
I have a Custom Post Type named 'Real estate' which has (amongst others) two different taxonomies:
'Purpose' (hierarchical; terms used are 'Living', 'Working' and 'Holidays') and
'Location' (non-...
1
vote
1
answer
1k
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
1
answer
779
views
Rewriting url for multiple Taxonomies and Custom Post Type
I have 2 taxonomies ( genre and artist ) and Custom Post Type ( Lyric )
the url structure i want to get is
CPT: /lyrics/ - archive page for CPT
Artist: /lyrics/artist/ & /lyrics/artist/song-...
0
votes
1
answer
878
views
Conditional if is single and part of the custom taxonomy
I want to write code only if it is single and part of the custom taxonomy. Here's how my custom taxonomy edit URL looks like:
http://example.com/wp-admin/term.php?taxonomy=us_pf_category&tag_ID=53&...
0
votes
1
answer
1k
views
How to set "manage categories" capabilities on a post type taxonomy but not on the general categories?
I want to set "manage_categories" capabilities on a post_type taxonomy but not on the general categories?
I've added to register_taxonomy:
'manage_terms' => 'manage_categories',
...
0
votes
1
answer
2k
views
Add other all taxonomies as meta boxes to custom post type
I have a custom post type which comes with a category taxonomy. This taxonomy shows as a meta box at the side. Pretty basic so far.
Now I want to add additional meta boxes below the content on the "...
0
votes
1
answer
1k
views
How to hook save-post function to use taxonomy term in post-slug?
Hook save-post function to check if taxonomy term is attached or not. If attached then, use taxonomy term in post slug like "taxonomy-term-other-words"...
0
votes
0
answers
14
views
Registering A Custom Post Type/Taxonomy from Plugin
I see similar questions, but I think I am just too inexperienced to understand the solutions.
I am using the Agile Store Locator, which allows us to manage multiple locations. I want to somehow ...
0
votes
1
answer
1k
views
Create a Hierarchical List of Custom Taxonomies AND Posts
I'd like to create a 3-tier hierarchical list of terms within a custom taxonomy, which includes up to 10 posts within each of the bottom-level term(s) only.
e.g.
Custom Taxonomy
- Parent Term 1
-- ...
0
votes
1
answer
3k
views
Get post terms with hierarchical relationships
I'm having a hard time getting a set of selected terms in a custom taxonomy presented in a specific way.
I have a hierarchical taxonomy 'places' and a post with the tagged terms:
England (x)
- ...
4
votes
1
answer
1k
views
has_term or in_category for Custom Post Types
I have property as a custom post type. I want to display a specific message if the property is in the sold category. To do that, I'm using the function below:
if ( has_term('sold', 'category')) {
?&...
0
votes
1
answer
2k
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
1
answer
20
views
Can't retrieve custom post type taxonomy term to custom post type editor
I have 2 main problems:
I can't seem to add editor_name custom field to default/native WordPress list of request URL query parameters.
This is the request WordPress is using:
http://localhost/wp-...
0
votes
1
answer
17
views
Is there a way to edit non-custom term attributes?
I have a custom post type (FAQs), taxonomy (FAQ Categories) and everytime I want to create one it appears all the same name, slug, parent, description fields. I was wondering... If there is a ...
1
vote
1
answer
3k
views
How to add custom label or texts in featured image
I have tried to add custom title or hint text inside the featured image box in Worpress custom taxonomy. but didn't get the solution. how to add a custom text underneath of the Click the image to edit ...
1
vote
1
answer
1k
views
WP_Query inside foreach loop returning same value for all options when filtered using ajax
I am trying to build a timetable to display classes by time. I have a taxonomy of Day, which I am looping over to create a column for each day of the week. In side the column is a WP_Query which ...
0
votes
1
answer
817
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
2
answers
1k
views
Primary Taxonomy for Post
My blog posts have have multiple items from my custom taxonomy attached to them.
For the sake of this post lets just use Tags taxonomy...
So a post may contain 4 tags, is there a way I can select one ...
0
votes
1
answer
739
views
How to get post type archive category title
I'm getting tired and confused so thought I would ask here before quitting for the day.
I have created a custom post type of membercontent
Under membercontent I have created the taxonomy ...
1
vote
2
answers
4k
views
how to show product custom taxonomies in woocommerce rest api
I'm working with woocommerce rest API v1 to build a shop page working with AJAX.
What I have tried :
created custom taxonomies for woocommerce products post type
set show_in_rest to true for those ...
0
votes
2
answers
17
views
Assign Default Taxonomy to Post When Created
I'd like to associate new posts created under a custom post type to automatically be given a custom taxonomy term. As a heads up here are the parameters
Custom Post Type Name: business_ser_dir_ltg
...
0
votes
1
answer
1k
views
Permalinks: custom post type -> custom taxonomy -> custom sub taxonomy -> post
I am building a custom post type and its respective custom taxonomy.
Here is the code:
add_action( 'init', 'register_my_types' );
function register_my_types() {
register_post_type( 'help',
...
10
votes
1
answer
966
views
Custom Taxonomy Endpoint Pagination using paginate_links()
The Setup
I have 2 taxonomies and 1 post type:
Post Type: products
Hierarchical Taxonomy: product_cat
Nonhierarchical Taxonomy: product_type
The product-category has a defined endpoint:
...
0
votes
1
answer
723
views
Permalink Rewrite to include Custom Taxonomy Term
I've created a custom taxonomy for posts using
register_taxonomy(
'discipline',
array('post'), /* if you change the name of register_post_type( 'custom_type', then you have to change this */...
1
vote
2
answers
59
views
Add body class to custom post type
I'd like to add a category class to body_class for custom post type to change body background color. I tried to rework the following code to work with custom post types, but no dice. It works with ...
2
votes
2
answers
815
views
Outputting an array of term meta values in a custom WooCommerce tab?
Forgive me – my Wordpress/PHP skills are hilariously rudimentary, so I may not use the correct terminology.
I have added a custom tab to the WooCommerce single product page and need it to display a ...
0
votes
1
answer
1k
views
WordPress Multiple Taxonomy Query
I've a simple form made up of two multiple selects which (as if by magic) filters my posts archive with URL parameters:
<form class="filters">
<select name="country" multiple>
...
0
votes
1
answer
788
views
Display posts by alphabetical order
I just purchased a WordPress theme. I’m trying to sort post on one category into an alphabetical listing (glossary type of listing).
Example : https://www.udiscovermusic.com/browse-artists/
There are ...
0
votes
1
answer
757
views
How to display custom post types AND regular posts separately on a shared taxonomy archive?
I've looked over numerous questions and answers on problems somewhat related to this but can't seem to find the same situation or solution.
I have a custom taxonomy that needs to have an archive page ...
0
votes
1
answer
788
views
Check if any available product has specific attribute
How can you check if there are any products with a specific product attribute in the shop?
I could query (eg. with wc_get_products()) all products and check if they (or their variations) are in stock ...
1
vote
3
answers
1k
views
Permalinks when filtering multiple custom post types by single taxonomy
I've been working with Custom Post Types and Custom Taxonomies for ages but one thing I can never get right are the rewrites when applying a shared taxonomy to multiple CPTs.
For instance, I have ...
6
votes
2
answers
2k
views
Bulk term assignment for attachment taxonomies
I've created a custom taxonomy for attachments.
Everything ok, but now I want the ability to bulk assign its terms to attachments using the default wordpress media admin ('upload.php') bulk actions.
...
0
votes
1
answer
712
views
How to add meta fields to custom taxonomy add/edit page?
I have a custom taxonomy 'issue'. I tried to add some meta fields to the add/edit issue pages in the dashboard using the method explained by Ohad Raz (https://en.bainternet.info/wordpress-taxonomies-...
0
votes
1
answer
720
views
Check if value is a custom taxonomy category name
I'm needing to check a variable and if the slug doesn't match a custom taxonomy's category slug run a function. I can't wrap my head around what I would need to do in order to get the "categories" of ...
0
votes
1
answer
890
views
How To Create Dynamic Permalink To Custom Taxonomy List of Current Posts?
I'm looking for help with a problem I've run into and can't seem to workout myself. I have created my own custom taxonomy called series (code below). I am calling the custom taxonomy posts in a widget ...
0
votes
0
answers
9
views
How can I get the categories and subcategories separately?
I am using this code to get the categories and subcategories from the reference page. It is quite good because it allows me to sort them hierarchically. But I would like to give them two different ...
0
votes
0
answers
12
views
Right to Left WordPress (Farsi) Changing the Order of Taxonomy to Term in URL
Using WordPress Farsi(Right to Left), I am seeing an issue in my URL which is instead of rendering the URL as Domain/Taxonomy/Term/ format
I am getting in reverse order as Domain/Term/Taxonomy/
...
0
votes
1
answer
23
views
Display prev / next posts links from the same category with thumbnails in Wordpress
I am no so good in PHP and I would like to ask someone for help:
I want when I am in single post, to show something like related posts to this that I am in. But arrows links with thumbs to next and ...