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
66 votes
5 answers
22k views

Custom post types, taxonomies, and permalinks

This is driving me nuts and I'm sure it's simple but nothing I search for comes up with a simple structure (everything is very complex). I have a custom post type product_listing and a custom ...
RodeoRamsey's user avatar
  • 1,707
63 votes
4 answers
74k views

How to create a permalink structure with custom taxonomies and custom post types like base-name/parent-tax/child-tax/custom-post-type-name

I've been combing this site and google for the answer and I've come up completely empty. Basically I want to do exactly what this post asks, but I need a hierarchical taxonomy. The answer given in ...
Jeff's user avatar
  • 2,535
61 votes
13 answers
88k views

Using wp_query is it possible to orderby taxonomy?

My question is simple, I'm using WP_Query to retrieve some custom type posts filtering by a taxonomy using tax_query. Now my problem is I would like to orderby the taxonomy, but from documentation ...
yeope's user avatar
  • 777
59 votes
7 answers
100k views

How to get all taxonomies of a post type?

How can i get taxonomies of a post type? If I have a post type event and i need to find out the list of taxonomies that are attached to that post type. How do I find them?
Sisir's user avatar
  • 7,782
49 votes
5 answers
258k views

How do I query a custom post type with a custom taxonomy?

I need to grab any posts using a custom taxonomy. $args = array( 'post_type' => 'adverts', 'advert_tag' => 'politics' // Doesn't seem to work. ); query_posts($args); while ( ...
Stephen's user avatar
  • 593
49 votes
1 answer
76k views

Permalinks: custom post type -> custom taxonomy -> post

I am having trouble working with WordPress rewrite rules, and could use some help. I have a custom post type called _shows_. All shows have a single custom taxonomy category _show-category_. A ...
Paul T's user avatar
  • 667
46 votes
4 answers
231k views

Show all terms of a custom taxonomy?

I made a few custom taxonomies and I need to show ALL the terms from it, what I achieved so far is showing the taxonomies that are selected/chosen in a custom post type but I need all of them to show, ...
David H's user avatar
  • 751
45 votes
9 answers
120k views

How to Add Tags to Custom Post Type?

I have a custom post type called portfolio and I'm trying to add the tags taxonomy to it, how do I do this?
Joe Bobby's user avatar
  • 739
43 votes
4 answers
181k views

Get Posts Under Custom Taxonomy

I am not getting the posts under custom taxonomy(fabric_building_types). I am getting cat_id and cat->name also but not able to get the posts. $args = array( 'type' => '...
Parth Kumar's user avatar
43 votes
9 answers
123k views

Add category base to URL in custom post type/taxonomy

I am building an LMS type system in WordPress, controlled by Custom Post types. The post type is called Lessons (with a slug of courses) and it has one custom taxonomy (category) called courses. The ...
Zach Russell's user avatar
  • 1,043
39 votes
6 answers
60k views

Include custom taxonomy term in search

I have two custom taxonomies applied to two custom post types. the terms list on the sidebar just fine and will list all posts associated with it. However, if you search one of the terms in specific, ...
Norcross's user avatar
  • 3,077
36 votes
5 answers
30k views

What's the difference between term_id and term_taxonomy_id

The title says it all. At the moment in my custom taxonomies I'm getting the terms using the term id and taxonomy name. Thought this question would've been asked before but can't find it anywhere! So ...
Daithí's user avatar
  • 665
36 votes
2 answers
133k views

Custom Taxonomy specific to a Custom Post type

I want to create a custom taxonomy which behaves similar to the post type as a category behaves to a the default posts (on the grounds of /%category%/%postname%/ permalink structure) so that the posts ...
Saurabh Goel's user avatar
33 votes
5 answers
135k views

List all posts in custom post type by taxonomy

Is there a way I can list all posts in a specific custom post type and arrange them by the custom taxonomy term attached to them? For example; Taxonmy Term #1 Post Type Post Type Post Type Taxonomy ...
Dean Elliott's user avatar
  • 1,185
32 votes
8 answers
152k 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 ...
xLRDxREVENGEx's user avatar
32 votes
3 answers
158k views

"tax_query" parameter not working with WP_Query

I have a custom post type called 'episode'. Attached to 'episode' I have a custom taxonomy called 'video_type' that contains two terms: "bonus-footage" and "episode"; "episode" contains two child ...
Josh Farneman's user avatar
32 votes
2 answers
26k views

Mixing custom post type and taxonomy rewrite structures?

Basically I want to achieve a glossary using custom post types and have some issues setting up rewrites the way I want them to be. I want it like that: The main glossary URL: http://example.com/...
maryisdead's user avatar
32 votes
4 answers
71k views

Advanced search form with filters for custom taxonomies and custom fields

I'd like to build an advanced search form for a specific custom post type, having filters for the custom post types custom fields, custom taxonomies, and for a separate custom post types properties (...
pax's user avatar
  • 633
29 votes
5 answers
94k views

How can I get only parent terms?

Is there any way to get only parent terms from custom taxonomy or category?
Mamaduka's user avatar
  • 4,502
29 votes
3 answers
25k views

Can multiple custom post types share a custom taxonomy?

I'm considering rebuilding a drupal site in wordpress and am still wrapping my head around the differences between the systems - particularly cck/fields and custom content types and the different ways ...
ChadD's user avatar
  • 393
28 votes
6 answers
56k views

How do I exclude a custom taxonomy from the post loop

Is there a simple or easy way to exclude all posts from a custom taxonomy in the loop? I've been looking high and low, and neither SE, SO or Google seem to have a straight answer. I know it can be ...
Thomas's user avatar
  • 487
27 votes
4 answers
150k 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 ...
robertwbradford's user avatar
24 votes
9 answers
23k views

Remove taxonomy slug from a custom hierarchical taxonomy permalink

I created a 'forum' taxonomy, using these rules: register_taxonomy( 'forum', array('topic'), array( 'public' => true, 'name' => _a('Forums'), 'singular_name' => _a('Forum'),...
onetrickpony's user avatar
  • 13.6k
23 votes
4 answers
61k views

Custom post type single-{custom}.php not working

I made a custom post type with the machine name special_media_post and wordpress is simply not seeing the single-special_media_post.php. I am at a complete lose. It keeps defaulting to the index.php ...
BobbyDank's user avatar
  • 333
23 votes
2 answers
24k views

How to modify a taxonomy that's already registered

Today I needed to change the arguments on a custom taxonomy that was already registered by a third party plugin. Specifically I wanted to set the show_admin_column argument to true and change the ...
mrwweb's user avatar
  • 10.2k
22 votes
5 answers
29k views

Remove Custom Taxonomy Metabox from Custom Post Type Screen

I have two hierarchical custom taxonomies, each on a corresponding custom post type. I would like to remove the metabox for each on the post type's edit screen. I have read remove custom taxonomy ...
mrwweb's user avatar
  • 10.2k
22 votes
7 answers
63k views

Display all posts in a custom post type, grouped by a custom taxonomy

I’m working on a member page where I use a custom post type with a custom taxonomy. My custom post type is called member and my custom taxonomy is called member_groups. I want to list all the members ...
Mestika's user avatar
  • 770
21 votes
3 answers
125k views

Retrieve posts by term id custom query

i want to retrieve custom posts using using custom query . my taxonomy is recipe_tx and terms (Beef) , (Chicken) etc in it . i have tried using SELECT p.* FROM wp_posts p, wp_term_taxonomy tt, ...
Azeem Hassni's user avatar
20 votes
1 answer
28k views

get_terms - only top level

I am trying to get only top level term: $cat_args = array( 'parent ' => 0, 'number' => 10, 'hide_empty' => false, ); $categories = get_terms( '...
Aryan's user avatar
  • 420
18 votes
7 answers
27k views

Get terms by taxonomy AND post_type

I have 2 custom post types 'bookmarks' and 'snippets' and a shared taxonomy 'tag'. I can generate a list of all terms in the taxonomy with get_terms(), but I can't figure out how to limit the list to ...
Gavin Hewitt's user avatar
18 votes
5 answers
38k views

get_the_term_list without links in 3.1

What function will display custom taxonomies associated with a post as text? I'm currently using get_the_term_list which works great for a singular page but not so much when using a taxonomy in the ...
MTT's user avatar
  • 3,546
18 votes
7 answers
9k views

Inserting terms in an Hierarchical Taxonomy

I'm really having a few issues with inserting terms. Here is my scenario: I have a taxonomy called veda_release_type: //Release Type and Region $labels = array( 'name'=> _x('...
Manny Fleurmond's user avatar
18 votes
1 answer
130k views

Get Posts by Custom Post Type ,Taxonomy, and Term

Ok, so i have a Custom Post Type called "Services". This custom post type has a taxonomy called "Areas" and there's 5 terms in that taxonomy. Let's say I have 10 posts on "Services" and there's 5 ...
Rise's user avatar
  • 655
18 votes
5 answers
54k views

Change order of Custom Taxonomy List

By default WordPress orders custom taxonomies (as tags in this case) by alphabetical order not by the order they were entered in the tag box. Is anyone aware of a way to show the custom taxonomies in ...
curtismchale's user avatar
  • 2,599
17 votes
8 answers
75k views

Get the the top-level parent of a custom taxonomy term

How would I get the top-level parent of a given term? I am using wp_get_object_terms to get taxonomy terms on posts, but instead of showing all tagged terms, I only want to show tagged terms' top-...
supertrue's user avatar
  • 3,016
17 votes
6 answers
24k views

Theme localization of "slugs" (custom post types, taxonomies)

in my theme I want to define a series of custom post types and custom taxonomies, each one having its own customized slug; the base language of my theme is english, therefore the slugs will be in ...
unfulvio's user avatar
  • 1,814
17 votes
1 answer
35k views

Rewriting a custom-post-type permalink with taxonomy term?

I'm trying to rewrite my url for a custom_post_type named wr_events with one of its custom_taxonomy terms from event_type add_action('init', 'wr_events'); function wr_events() { ...
mathiregister's user avatar
16 votes
1 answer
13k views

Saving Taxonomy Terms

I have an interesting problem which I hope someone can quickly answer. I have created my own metabox which, based on "MY METABOX CODE" (list below) is correctly displaying a dropdown list of all my ...
NetConstructor.com's user avatar
15 votes
3 answers
34k views

Custom Taxonomy as checkbox or dropdown

I have registered a custom tax to my CPT. On the edit screen the tax meta box appears with an autocomplete field. Is it possible to display it as checkboxes or dropdown instead?
Julian F. Weinert's user avatar
15 votes
6 answers
13k views

Custom taxonomy terms not showing as list Gutenberg Editor

I have created a custom taxonomy that I have associated to my CPT. both appear on my dashboard, the issue is that when I add content and I want to choose a term from the list of the custom taxonomy, ...
Hanane's user avatar
  • 253
14 votes
3 answers
9k views

Get The Post Type A Taxonomy Is Attached To

Being given a taxonomy or term, is is possible to pull any / all post types the taxonomy is attached to? For example, knowing the built in taxonomy category or being given a term in the category ...
Howdy_McGee's user avatar
  • 20.6k
14 votes
4 answers
28k views

Custom post types filtered by taxonomy using REST API v2

I have the following situation: I created a custom Post Type names Works. And also attached to it custom taxonomy named Work Types Here is the code function rk_work_post_type(){ $labels = array( ...
Scriptile's user avatar
  • 411
14 votes
2 answers
9k views

Altering the appearance of custom taxonomy inputs

I'm working on a site that will make use of a few custom taxonomies (for custom post types). I've chosen to make some of the taxonomies hierarchical because the method of inputting values (checking ...
Travis Northcutt's user avatar
12 votes
6 answers
92k views

How to only list the child terms of a taxonomy and not their parents?

I'm creating an age select menu in the admin, populated from a taxonomy of age. The taxonomy is hierarchical as follows: 18-25 (parent, ID 183) 18 (child) 19 20 21 22 23 24 25 26-30 (parent, ID 184)...
Andrew's user avatar
  • 1,163
12 votes
2 answers
64k views

Getting custom taxonomy from custom post type

I have a custom post type called email_block and have a custom taxonomy called block_type. I need to loop through all the email blocks find out what custom taxonomy (block_type) they have. I know how ...
imz's user avatar
  • 123
12 votes
4 answers
49k views

Check if Current Category has Children

I need to tell whether or not the current custom taxonomy archive page I'm viewing has child categories. I've got a situation where there are a lot of custom categories with children and the site is ...
user29489's user avatar
  • 143
12 votes
3 answers
23k views

Taxonomy: Why 'with_front' => false DOES NOT WORK?

Seriously, why 'with_front' => false does not work as it should be? It is supposed to remove TAXONOMY BASE NAME and my question is why it does not work? I just dont want the taxonamy base slug ...
Alex's user avatar
  • 305
12 votes
1 answer
46k views

Get term SLUG by term ID

I have a hierarchical taxonomy called 'tarefa' I have to display all posts from a child taxonomy. I used get_term_children function function to verify if the taxonomy parent has children. If the ...
Sergio Soares's user avatar
12 votes
1 answer
274 views

Is ACF being a honey trap? [closed]

I am an enterprise full stack developer and started using ACF. At first I thought that ACF is a one stop solution for a web site but after researching more on taxonomy I am afraid that using it will ...
Yaron's user avatar
  • 255
12 votes
1 answer
4k views

Shouldn't this be easy?! Custom post type/custom taxonomy permalink

So this is driving me absolutely insane. I've spend days trying to fix this and I can't work out why this is so difficult as surely this is a very common permalink structure! I looked through ...
fxfuture's user avatar
  • 1,337

1
2 3 4 5
90