A taxonomy is a generic "category" used to organize posts and custom post types

learn more… | top users | synonyms

2
votes
1answer
956 views

How to get the depth of a category's subcategories

I'm looking to get the depth a category's subcategories. Suppose I have a category 'grandparent' which has a subcategory 'parent' which in turn has a subcategory 'child'. How do I get to integer 2? ...
0
votes
1answer
25 views

Get pages only with a specific taxonomy

I added a custom taxonomy called 'post_tag' to the pages, and I am trying to make a query that gets only the pages that have a specific tag set. I already tried in several different ways, even using ...
1
vote
8answers
5k views

How do I list custom taxonomy terms without the links?

I've searched far and wide to try and find an answer to my question. I'm hoping I can get help here. Here goes... I'm currently retrieving the terms of my custom taxonomy using: <?php echo ...
0
votes
0answers
20 views

Order posts by term in alphabetical order

I know it's possible to order by terms, but having migrated a huge amount of data from a different CMS, I'm left with a list of brands that are taxonomy terms. I'm using ACF to present the terms as a ...
2
votes
1answer
30 views

Is there a filter hook that I can use to change how taxonomy term names are displayed?

I need to hide a custom taxonomy's terms' names on the frontend while preserving them on the backend. Instead of the terms' names I need to display pseudonyms. I can't find a single filter hook to do ...
0
votes
0answers
23 views

Help to fix custom post rewrite + taxonomy. Simple pages show 404

I'm getting 404 for each page. I want to have structure and pages like: url/page-sample url/taxonomy url/taxonomy/custom-post Example of structure (just trying to explain): url/about-us-page url/...
0
votes
0answers
20 views

Taxonomy archive: Query all posts first, and then group by taxonomy term?

I have two taxonomies: 'season' and 'style'. On my 'season' archive template, the following query groups all the 'season' posts by their 'style' term. This works great. But the problem is that I ...
0
votes
1answer
29 views

Permalinks for a custom post type - with a page template (custom query) and taxonomy archive

I'm having trouble getting my permalinks working with a specific custom post type setup. Here's the code for the custom post type: function jc_attactions() { $labels = array( 'name' => '...
0
votes
1answer
2k views

How to add upload field in a custom taxonomy?

I have a custom taxonomy and I want to add a custom field inside , OK that's seems to be easy but the hardest part is when I want to add a file input type the enctype="multipart/form-data" I ...
-2
votes
1answer
75 views

Get posts that matches specific terms of multiple custom taxonomies

I'm working on a page that show a lot of products. My structure is Product (custom post type) -->Brand (custom taxonomy) ------>Brand A (custom term) ------>Brand B (custom term) -->Department (...
0
votes
0answers
39 views

WP Query with sticky posts and tax_query

I have this query; $posts = new WP_Query(array( 'post_type' => 'post', 'posts_per_page' => 5, )); Which correctly places sticky posts at the beginning. However,...
0
votes
0answers
16 views

Display posts in a custom taxonomy, grouped by a different taxonomy

The setup: I have a custom post type called products. I have a custom taxonomy called styles with terms modern, classic, rustic. I have another taxonomy called seasons with terms fall, winter, ...
0
votes
1answer
159 views

Copy/Move selected taxonomy terms to another taxonomy for posts

I've been searching for about 2 hours now on a solution of copying/moving selected taxonomy values for each posts to another. Here's the situation. I'm working on a site that has a post type of ...
1
vote
0answers
70 views

Sorting a specific taxonomy by archive date using URL

OK, so I'm looking for a way to sort a specific taxonomy by archive date using the site URL. Say the custom taxonomy ("sort") value is "fruit" then then you would currently get all the posts marked ...
1
vote
1answer
59 views

Filter blog archive by category in URL

I've created a fairly basic form that allows users to filter post type archives by their taxonomies. On custom post types this is super simple to do by simply setting ?taxonomy_name=term_slug in the ...
1
vote
1answer
36 views

Attaching taxonomy data to taxonomy with wp_insert_post

By WP User Frontend I create a registeration form with some checkboxes, and use wp_insert_post and update_user_meta for create a new post (post type pavilion) on user registration.I want when checked ...
26
votes
3answers
26k 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?
1
vote
2answers
701 views

How to limit the number of terms (terms acts like categories)

Hello i have created taxonomy in custom post type that act like category. then i have created terms that acts like categories. i have create widget that show all terms from taxonomy. all works great....
1
vote
1answer
38 views

Return Taxonomy/Term Information with Posts (WP_Query/get_posts)

Is it possible to return taxonomy/term information for posts along with the posts themselves when querying with get_posts? I have around 150 items I am querying so I don't want to loop and pull each ...
0
votes
1answer
59 views

wp_get_post_terms on custom post type with custom taxonomies returning an empty array

I am trying to get the taxonomy values associated with my custom post types. I have a function which fetches a post ($object)'s taxonomies, then cycles through the taxonomies and gets the values for ...
1
vote
1answer
41 views

How to get post's current parent term ID?

How do you get the ID of the parent term of the current child term assigned to a post. For a custom taxonomy? Custom taxonomy: "location" Countries Japan USA Mexico Cities New York Austin ...
0
votes
0answers
10 views

Same Permalinks for Custom Post Types and Category Taxonomy

I am trying to figure out how it is possible to use the default WordPress Category taxonomy across my entire WordPress site, including three custom post types that I have defined. I would like to ...
0
votes
0answers
9 views

Display nested taxonomies with current class

I have a Wordpress site with a Products custom post type (I'm not using Woocommerce as it is not an ecommerce site). The custom post type has taxonomies with 2 levels (top-level categories and sub-...
0
votes
0answers
17 views

sub categories and products that are directly assigned to main category not displaying

I have a scenario in which i have a side bar. In side bar all the main categories are displayed. There are also some sub categories that are assigned to main categories. Now i want to display both sub ...
1
vote
1answer
41 views

How to get the number of child categories a specific parent category has?

How do we count the number of child categories of a parent category? I am using a custom taxonomy, called: "authors". I found this code, which does count the number of child categories, but only ...
5
votes
3answers
9k views

How to add a default item to a custom taxonomy?

Wordpress default taxonomy (Categories) has the item Uncategorized by default. How to add a default item to a new custom taxonomy? functions.php: // === CUSTOM TAXONOMIES === // function ...
0
votes
0answers
19 views

Taxonomies not display the content

I create a custom post and a page to post a specific content. My functions.php: add_action( 'init', 'create_post_fotos' ); function create_post_fotos() { register_post_type( 'Fotos', array( ...
0
votes
0answers
12 views

Use tax_query to sort posts by most “categories in common”

I know I can use tax_query but what I really want is to sort them by "most categories found that are equal" Is there a way to do it easily?
0
votes
0answers
18 views

I want to add tag id to search query in wordpress

I have a custom search form which get result like this http://localhost/car/?post_type=cars&vehical=sports-car&manufacturer=truck&country=australia&state=new-yourk By using this ...
0
votes
0answers
16 views

Display admin notice on category creation

I'm trying to display a custom admin notice when admin creates new category but can't make it work. My code so far is: function pippin_admin_notice() { echo '<div class="updated"><p>...
0
votes
0answers
29 views

Custom Post Type Re Write not working

I am trying to get my custom post type single.php URL to have the category in it. I am using the default wordpress categories (I didn't register a custom tax.). My current URL (from the base) looks ...
0
votes
1answer
25 views

Attachment Metadata inside of Loop

Basically, I'm trying to call attachment info to display withing a loop, for use in an image gallery. I know I need to use wp_prepare_attachment_for_js($attachment_id) but I can't seem to get anything ...
0
votes
1answer
26 views

Best approach to allow front-end display of posts’ reviewers?

My first question here; please forgive any protocol lapses. I manage an academic journal that publishes on Wordpress. We use Co-Authors Plus to allow collaborative articles. Each article also has two ...
1
vote
1answer
68 views

Could not insert term into the database

I've spent a fair while reading about the "Could not insert term into the database" error, but the fixes I have read (changing theme, fresh WP install, disable plugins) simply are not working. I ...
0
votes
1answer
441 views

Display a tag only if there is a description

I'm building a site glossary and trying to display only tags with descriptions. Is there a way to determine if the description is available and only display the tag when it is? Here is where I am so ...
0
votes
0answers
41 views

Issues with custom taxonomy

Having issue with url structure and pagination for custom post type and custom taxonomies. We have the category page of custom taxonomy working on first page but on others it gives error. Example of ...
0
votes
0answers
30 views

How to get post count including nested categories

I am traversing through categories using function like this function hierarchical_term_tree($category = 0) { $r = ''; $args = array( 'parent' => $category, ); $next = ...
1
vote
1answer
143 views

I used the Tax-meta-class by bainternet but i still can't get it to display any of the results.

here's my code: $config = array( 'id' => 'tax_meta_box', // meta box id, unique per meta box 'title' => 'Tax Meta Box', // meta box title 'pages' => array('...
2
votes
0answers
68 views

Can we have same term slug in different taxonomies?

I am having problem when creating term with same slug in different taxonomies. I researched that Unique key is removed from slug in wp_terms table, so i am getting problem to figure out that why i am ...
0
votes
1answer
18 views

Suggest Users basing on User taxonomy

My question is for getting informations or directions about how to move for a task I have to do. This is just a request for advices due to the fact I'm not an expert in wordpress development. My task ...
0
votes
0answers
25 views

Terms showing empty inside a loop

I have the following problem: I have 2 taxonomies that belongs to a custom post type What i want to do: Loop = taxonomy 1 loop = taxonomy 2 loop = post type My code works but, it shows ...
1
vote
1answer
48 views

Taxonomy archive page WP_Query does not return get_the_permalink() or get_permalink() value

In a taxonomy archive page, within the following loop: $type = 'classes'; $page_taxonomy = get_query_var( 'classes_class_type', 'yoga' ); wp_reset_query(); $args=array( 'post_type' => $type, '...
4
votes
2answers
16k 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' => 'post'...
1
vote
1answer
6k views

How to create new category for custom post type?

I have create a custom post type named "jobs", and I want to create a set of category for that, ie like "PHP Jobs", "Python Jobs" etc. $args = array( 'labels' => $labels, 'public' => ...
0
votes
0answers
20 views

Relating two taxonomies together

I'm trying to link two taxonomies together: retailer and category. Each retailer will mostly be assigned to the same category so I thought if I can associate the retailer with the category from the ...
3
votes
0answers
72 views

Hook to process a new taxonomy tag before it is created?

I am working on a website where there is a custom taxonomy for places, which can be either cities or states. The users are supposed to tag each post with a city and a state. To deal with ...
0
votes
1answer
219 views

Non-Recursive get_term_children()

I have a custom taxonomy called product_category. There are child terms 3 levels down. They look like this: Term1 Term2 Term3 When I am on the taxonomy page for Term1, I wish to use ...
1
vote
3answers
63 views

How do I apply style to each category of a list?

I need to create a simple plugin to show a list of categories inside the body of the post and, as I am new to coding, I searched for the basics and started to make little changes; it looks like this, ...
0
votes
0answers
24 views

Permalink custom post type and custom taxonomy

I have problems with making permalinks. I have multiple custom post types. Lets say cpt1 cpt2 cpt3 I have one custom taxonomy with few categories. Lets say : cat1 cat2 cat3 All custom post ...
0
votes
1answer
37 views

Foreach inside foreach

I got two taxonomies: "Colours" and "Recommended Colour" both have the same terms (same colours). I want to display a list of all terms of the taxonomy "Colours" and mark one colour as recommended. ...