Skip to main content

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
1 answer
378 views

Wordpress Shorcode Display hierarchical taxonomy [child, parent]

I have a slight problem to display the parents of taxonomy in wordpress. (CPT=property and tax = property_city) I did a little research to figure out what to do. but I can't quite figure out how to ...
neosan's user avatar
  • 117
1 vote
0 answers
243 views

wp_get_object_terms returns only Uncategorized on first publish

I would like to get all assigned categories of a post once it's published with the save_post hook: add_action( 'save_post', function( $post_id, $post, $update = null ) { if ( 'publish' == $post-&...
Xaver's user avatar
  • 1,039
0 votes
0 answers
23 views

new custom filed not showing in taxonomy

I want to add a new ACF filed to my taxonomy page, but the text isnt appearing. I have tried <?php the_field('extra_text');?> <?php the_sub_field( 'extra_text' ); ?> but neither one work. ...
Robin's user avatar
  • 1
0 votes
0 answers
393 views

How to display acf repeater in tag archive page?

I want to show some repeater fields on tag archive page. with this code I can display the simple text fields of acf: $term = get_queried_object(); $meta = get_field('test', $term); but when want to ...
Mohammad J's user avatar
1 vote
0 answers
28 views

How to build custom route by adding taxonomies to URL ? ex: www.demo.com/communities/palo-alto/

I am trying to achieve this in WordPress, but no luck Here '/communities' is custom Taxonomy of post type 'PAGE', '/Palo-alto' is term from communities taxonomy . I want user first to click on ...
Shubham Shinde's user avatar
1 vote
0 answers
802 views

Advanced Custom Fields displaying on tag pages

I have edited Advanced Custom Fields before but never set anything up from scratch, always relied on developers. But I'm wanting to do a very specific thing and I was hoping I could do it by myself. I ...
c_me's user avatar
  • 11
0 votes
1 answer
42 views

Get Child Category only

I am using this code to retrieve category: $post_id = get_the_ID(); $countries = get_the_terms( $post_id, 'country' ); $fcountry = $countries[0]->slug; However this sometimes retrieves the ...
JoaMika's user avatar
  • 678
0 votes
1 answer
191 views

How to add a dynamic dropdown derived from custom taxonomy

I have created a custom taxonomy state and city. I want to fetch all the city for a given state using a drop down list. suppose first i need to select a state and then drop down automatically ...
Sumit Jangir's user avatar
0 votes
1 answer
143 views

Display all subterms of a custom taxonomy filtered by parent terms

I have a custom taxonomy which i called 'fonte' that should display a list of books. These are divided in two parent terms, 'mixed' or 'single'. So the hierarchy is something like that: Mixed book1 ...
Marco Vez's user avatar
0 votes
0 answers
18 views

My list of terms of custom taxonomy displays 7 times

I'm building a custom page template to show a list of terms from a custom taxonomy named "autore", and I don't know why it displays the full list more than one time (seven times, to be ...
Marco Vez's user avatar
0 votes
1 answer
1k views

Get taxonomy name for the current post

I am trying to get the name for a custom taxonomy assigned to the current post and in my template I have: $countries = get_terms( 'country', array('hide_empty' => false,)); $fcountry = $...
JoaMika's user avatar
  • 678
0 votes
2 answers
168 views

Custom field with terms from another taxonomy programmatically

I have a custom taxonomy A with some terms (A1, A2,A3, etc) and a second custom taxonomy B. I want to create a custom field in taxnomony B which will be a dropdown menu with the terms from taxonomy A. ...
marissalianam's user avatar
0 votes
0 answers
45 views

Taxonomies and subtaxonomies relations

I am struggling with how to relate taxonomies and subtaxonomies in wordpress. I have one custom taxonomy (Courses) and a subtaxonomy (Recipes) from Courses. I also have another taxonomy (Country) and ...
marissalianam's user avatar
0 votes
1 answer
41 views

How to assign tag to custom post type in wordpress?

I’m pretty stuck on this wordpress challenge where I need to programmatically assign a taxonomy to a custom post type. How can I successfully assigned programmatically a tag to a custom post type? Im ...
robskrob's user avatar
  • 111
0 votes
1 answer
215 views

Limit categories to hierarchal depth of 2

Is there a way to limit the standard post categories to only allow one level of subcategories? For example, allow the following: Fruit > Apple Veg > Lettuce But from here, do not allow &...
Mr DC's user avatar
  • 13
0 votes
0 answers
21 views

Filtering posts based on three taxonomies

I've built a filterable post listing where the user can filter based on two taxonomies, this is working but I now want to add a third taxonomy to the filter, but I think the logic I'm using isn't very ...
FreddieE's user avatar
  • 113
0 votes
0 answers
19 views

Retrieve the child terms by having the parent's information

I have access through a series of joins to the terms table, in order to bring out all the taxonomies that are associated with the post if I wanted to. with this code: <?php echo "{$r->...
user14441695's user avatar
2 votes
0 answers
460 views

Show Post Count of a Category

I've been stuck on this for a little while now, and have tried multiple ways to achieve this with no luck. I've been looking for two ways to display the total posts found on a specific, and non-...
Auromnia's user avatar
1 vote
1 answer
298 views

Taxonomy archive showing no results

I have the file taxonomy-project.php and am trying to view results for some of my terms. I keep getting a result of NO even though I have a post applied to that particular term. taxonomy-project.php &...
user avatar
1 vote
1 answer
307 views

how to show only last child terms of a taxonomy

I'm trying to show the only the last child terms of a taxonomy in a post. For example, the post "Johnny Pastafrolla" has the following terms of the taxonomy "camp" selected: ...
Dande's user avatar
  • 25
0 votes
0 answers
41 views

Define multiple prefixes for custom post type

I have created CPT called "Pharmacy" which have a lot of pharmacies inside (approx 10.000) Pharmacies offer 2 different services (skin & scalp) and some provide both services but some ...
Dachony's user avatar
0 votes
1 answer
33 views

How can i conditionally load taxonomy-{taxonomy}.php template php files through functions.php

I have a movie review site, i would like to conditionally load the taxonomies of actors and directors only if a option of my theme is active. At the moment in the root theme folder I have these 2 ...
Vincenzo Piromalli's user avatar
0 votes
0 answers
192 views

Display category filters for custom post type when category is shared by multiple post types

I already have a solution to this problem but I'm wondering if there's a more efficient way to do it. I have a custom post type called "galleries" that uses the same taxonomy as blog posts. ...
Jake1293's user avatar
0 votes
1 answer
26 views

Fill New Taxonomies

I will explain my scenary and then my problema.. I have more than 10.000 products on my woocommerce categorized by differents name. IE car parts. I need yo create a new type of taxonomy that I will ...
nachoLibre's user avatar
0 votes
1 answer
44 views

Is there is a way to group a large number of WordPress Multisites For Easier Organisation?

I did some extensive Google searching before this and I have come up empty-handed, so I am hoping someone has a better idea of what my options are here. I am planning on using WordPress for an ...
Dwayne Charrington's user avatar
0 votes
1 answer
76 views

JS POST update data taxonomies

How can I call the value of each term with my js function? I need use a Array not just ` useractivities=[]; $('.user_activities').each(function(){ useractivities.push( $(this)....
Anarko's user avatar
  • 11
0 votes
0 answers
398 views

Checking if a product ID has taxonomy term attached not working with has_term

I am trying to figure out if a woocommerce product ID has an associated taxonomy term attached to it. The below id 434 does indeed have an attached rimless term in the material taxonomy but the below ...
Keith's user avatar
  • 1,546
1 vote
2 answers
272 views

Retrieve taxonomies from arbitrary site

Background I need to retrieve terms for a post in an arbitrary site on a multisite network. This is not necessarily the site that the WP instance is running in at that moment. wp_get_object_terms() ...
XedinUnknown's user avatar
0 votes
1 answer
2k views

How to set acf color field as background color to product category

I have set an acf color picker field for woocommerce product category. I would like to set this color as a background to the category name that I've printed on the product page. I've tried to set the ...
Ben's user avatar
  • 3
1 vote
1 answer
241 views

Get authors by term id or slug

This question sounds wired but I am in a situation where I need to list all author who posted in a particular term. What I did so far, I am able to get all posts under a particular term and stored the ...
Subhojit Mukherjee's user avatar
0 votes
0 answers
84 views

add pagination in wordpress page template

I am using custom page to display my taxonomy terms the terms are displaying fine but i dont want the terms to all show in one page i want 2 terms per page but the pagination is not working and its ...
MY Design's user avatar
0 votes
1 answer
4k views

Show Taxonomies with admin area for custom post type?

I'm not sure if this possible, but I'd like to be able to show my taxonomies within the admin area of my custom post type so that WordPress users can sort the posts my e.g. subject. Here's my code ...
M.T's user avatar
  • 35
1 vote
2 answers
346 views

WordPress Customizer - pass setting value into another control to live update drop-down choices

In the WordPress customizer script, I am trying to pass the value from a select control into a custom control that displays taxonomies associated with the selected value (1st control). $wp_customize-&...
730wavy's user avatar
  • 193
0 votes
1 answer
24 views

Showing related post for custom taxonomy

I need to edit single.php file in order to show related post for a custom taxonomy I've already created (named 'tag-italia). Can anyone help me to achieve that? For the "general" related ...
Luca's user avatar
  • 1
0 votes
0 answers
100 views

How do I get the correct URL?

Helo, WordPress Community! Help me, please. Created a custom post type with one taxonomy added as a category. Overwrite rules have also been created to display the complete structure of the CNC, for ...
Tolyan Dimov's user avatar
1 vote
1 answer
1k views

How to Filter custom post type by taxonomy?

here is my code trying to make it <div class="row"> <div class="col-lg-3 col-md-12"> <div class="card"> <div class="card-body&...
ialyzaafan's user avatar
0 votes
3 answers
1k views

How to give each category name its own ACF background color?

I'm building a webshop, and started to configure the product loop on the shop archive page. I display the product category related to every product, and I would like to set to the categories to have a ...
Ben's user avatar
  • 3
0 votes
0 answers
49 views

Noticed updating taxonomy terms take a long time and run out of memory

Not sure if it's related to 5.5, that is what we're running. But if we go to edit a taxonomy term (say... update the description). It's been taking a long time. Some investigation reveals that it's ...
Dan Goodspeed's user avatar
0 votes
0 answers
102 views

Can I create a tax query to return posts that match two slugs from same taxonomy

What I'm trying to achieve: I have a taxonomy 'module_data' which is hierarchical. What I want is to use a tax query to get all posts that match a slug in an array of slugs for terms AND also match a ...
Eujinks's user avatar
  • 139
0 votes
1 answer
344 views

Can't display multiple terms with get_the_terms

I am trying to display the terms (from a custom taxonomy) of a single post, but I can't display more than one term. When I try to display all the terms using a foreach loop, it doesn't display ...
Paul G's user avatar
  • 1
0 votes
1 answer
212 views

How to target all woocommerce categories that don't have any subcategories in them?

I want to target all pages (product categories) that are displaying the products themselves. My woocommerce settings set to show only categories/subcategories (unless there are none) and then by ...
Victor's user avatar
  • 25
1 vote
1 answer
141 views

$_FILES empty on created_{taxonomy} and create_{taxonomy} yet is is not on edit_{taxonomy}

been struggling with a bug. On created_{taxonomy} hook yet in edited_{taxonomy} hook works and upload the expected file with no issues. As per the following code I added custom field type along with ...
Khan's user avatar
  • 11
0 votes
1 answer
1k views

WooCommerce WP_Query using tax_query returns no results (0 = 1)

I am trying to get specific Products from WooCommerce baseed on a Product Attribute (taxonomy). $args = array( 'post_type' => array('product', 'product_variation'), '...
kernel52's user avatar
1 vote
1 answer
527 views

Setting posts_per_page for taxonomy term template

I have a custom taxonomy term page set up to display posts associated with that term (taxonomy-insight_type-academia.php). I figured I could use the following to limit the posts on that page based on ...
Phill's user avatar
  • 197
2 votes
0 answers
29 views

Mixed unrelated taxonomy in permalink

we have a situation where we want to build permalinks using mixed (unrelated, ie not hierarchical) taxonomies in permalinks on a wordpress site. and we dont want the taxonomy name in the actual link. ...
Vauneen's user avatar
  • 21
1 vote
1 answer
1k views

WP REST API not retrieving all categories

I am developing a project that is using the WP REST API. After some tests, I realized that it's not retrieving all the categories based on what I am trying to GET. In precise, there are supposed to be ...
abhivemp's user avatar
  • 113
1 vote
0 answers
90 views

Rewrite Rule Working for all but one of the taxonomies created

I have a hierarchical taxonomy, county, which takes a parent and child taxonomy as well as a rewrite rule to include them in my permalinks. I have three of these county taxonomies, but only two of ...
itsseanl's user avatar
1 vote
1 answer
189 views

How to get the top level parent term Advanced Custom Field values in the child terms

I am using Advanced custom fields in my product_cat taxonomy to display fields on my product category pages. I would like to be able to edit the top parent product category and have those changes ...
moorewebx's user avatar
0 votes
1 answer
27 views

Test if taxonomy on current page has at least one term with more than one page tagged with that term

Is there a (simple?) way to test if a taxonomy has at least one tag that is used on more than one page? I know how to see if there are any terms in a given taxonomy on the current page. And I know how ...
HopefullCoder's user avatar
1 vote
0 answers
16 views

Is it possible to have dedicated page for parent/child taxonomy?

I've been working non-stop on this for the past few days. I have a post type, floorplan, which has a hierarchical taxonomy called County. Each County taxonomy has child taxonomies with the names of ...
itsseanl's user avatar

1
3 4
5
6 7
40