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
0answers
7 views

Related Video Post by Custom Taxonomy “ Actor”

This my Related Video Post Template by categories. wp_get_post_categories( $post->ID ), 'numberposts' => xbox_get_field_value( 'wpst-options', 'related-videos-...
0
votes
0answers
8 views

Add meta noindex to post if it has a specific taxonomy

How can I add the following line to the current post if the product_type = 'enviso_group_ticket'? <meta name=”robots” content=”noindex,nofollow”/> product_type is a default taxonomy of the ...
0
votes
0answers
8 views

How to show CPTs in term archive

I attached default taxonomy "category" to a "story" custom post type, when I register it: 'show_in_rest' => true, 'show_in_feed' => true, 'taxonomies' => ['...
0
votes
0answers
7 views

Count for Media Library Attachments specified by Categories

I've added this function into my function.php file that allows me to specify images in my media library with categories. /* Add Categories for Media Library Attachments /*------------------------------...
0
votes
0answers
10 views

Menu items not found on category or tag page

I have the following menu call in the header.php file <nav id="site-navigation" class="navigation main-navigation" role="navigation"> <?php wp_nav_menu( ...
0
votes
0answers
19 views

Dropdown custom taxonomy with parent and child

i am trying to autofill all the parent field in a dropdown menu by selecting child (i know usually is the opposite, basically i have nested location with this structure: country state city area state ...
0
votes
0answers
8 views

Get ACF Taxonomy select values to update based on previous field selection

I have three Taxonomy fields on my page ('Sector', 'Subsector' and 'Key Role'). The Taxonomy itself is called 'Job Category', and 'Subsector' and 'Key Role' are both children of 'Sector'. So for ...
0
votes
0answers
18 views

What is the best approach to rebuild product category tree completely?

I have a pretty large hierarchical list of product categories (almost 300) which I need to rebuild from scratch. Once the category tree is completed, I need to re-assign all existing products (more ...
0
votes
0answers
12 views

Url leading to archive page, no matter what

A client passed me a website I do not know how to fix: a specific url leads to an archive.php page, no matter what. Say the url is 'classes', I created a page with /classes/ as url, but I get always ...
0
votes
0answers
31 views

tax_query not working on custom post type

For some reason my tax_query is returning 0 posts. I'm able to assign posts to the Tax and the archive pages work correctly. When I try to create the below custom query the post_count in the ...
0
votes
1answer
11 views

How to show taxonomy on front page

I have set template taxonomy-event_type.php which displays just right on http://localhost:8000/types/<type_name>/. What I need now is to: either redirect when user lands on http://localhost:...
0
votes
1answer
14 views

Save queried result into database

in multi author website when author publish post , he/her can give star rating to his/her own post. and I can display average rating for every taxonomy term using this formula: AVERAGE RATING=TOTAL ...
2
votes
1answer
38 views

Get the term for an taxonomy archive when the term has no posts

Seems like it should be simple (the Stack Overflow catchphrase) A taxonomy archive taxonomy-my-taxonomy.php, I'm using $terms = get_the_terms($post->ID, 'my-taxonomy'); to get the properties of ...
0
votes
0answers
20 views

Why doesn't 'post__not_in' work with 'cat'?

When I write 'cat' => '45', then post__not_in does not work, if you remove cat, then everything works without problems. I would be grateful for your help $args = array( 'posts_per_page' =>...
1
vote
2answers
33 views

Formulate a url to show posts with both taxonomy terms

I would like to show an archive of posts that have two taxonomy terms in common. So for example, I'd like to show all posts that have both the terms "sauce" and "cheese" in the ...
0
votes
1answer
19 views

Get Posts by Category, Tag , and CPT Taxonomy

How to print only those posts which have Category, Tag, CPT Taxonomy. I have tried out with this code but nothing prints. To print posts I used SS [commonposts category="2" tag="3" ...
0
votes
0answers
10 views

Change post status based on taxonomy

Need help with this code. I want to change status of a post if a taxonomy is Y value. The code I have, based on other I saw for meta fields. //add_action('init','my_hourly_event'); function ...
1
vote
1answer
39 views

Custom query to filter posts that have current post as a taxonomy [closed]

Introduction I'm a graphic designer that knows nothing about PHP, but I need to get my hands dirty in this particular situation and I need help from the coding gods. I've been struggling with this ...
1
vote
0answers
25 views

Searching in wordpress using wp_term_taxonomy table

I have been trying for some time now to return search results not only of products from woocommerce but also for anything that is found on the rest of my site. If you search for SKU "4110-26"...
0
votes
1answer
30 views

How can i display a taxonomy? i have created a plugin and then a custom type. and a taxonomy , also i have register it

So my question is where i can place the code to display the taxonomy? i found this code `function get_taxonomies( $args = array(), $output = 'names', $operator = 'and' ) { global $wp_taxonomies; ...
0
votes
0answers
6 views

Sort terms of attributes by date modified or as per user selection, in product backed of woocommerce

Sort terms of attributes by date modified or as per user selection, Right now it is sorted alphabetically when we select any terms from the box in a product backed of woocommerce
0
votes
0answers
17 views

How to Show All Categories Related to a Tag

Is there a way to show all categories in a tag page (all categories from posts by a tag)?
1
vote
0answers
14 views

Automatically check parents (in a taxonomy) when child is selected

On my website I have a custom taxonomy which contains a lot of parents, children, subchildren etc. Because of this, it is really long to manually find what I want, so do you know if there is a way to ...
0
votes
0answers
20 views

Moving a meta field value in a taxonomy

A meta field was created, but it is not so convenient to use it, so a taxonomy was created, now for each entry need to transfer the values from the meta field to the taxonomy field, did this function ...
1
vote
1answer
21 views

How can I increase the length for the taxonomy term slug?

I am trying to create a new term in topic taxonomy. Since I am writing in Bangla Unicode instead of English, the slug is created with lesser/broken text. Is there any hook to update the length for the ...
2
votes
1answer
64 views

Paginate_links won't create the right links on a taxonomy filtered custom post type archive

after hours and dozen of tests and messes... i'm face to the wall and fed up searching (mainly cuz my google's answers are already all clicked !) I'm trying to display paginate_link with a filters ...
1
vote
0answers
50 views

What is faster: custom taxonomy or serialized post-meta for db retrieval? (over 60,000 posts)

I have a search plugin that can search serialized metadata as well as categories (for multi-checkbox). Is there any advantage to using serialized post metadata instead of creating a custom taxonomy ...
0
votes
0answers
18 views

How to set the same base url for two different taxonomies?

I have created two custom taxonomies. function themename_custom_taxonomies() { // Coaching Method $nieruchomosc = array( 'name' => _x( 'Nieruchomość', 'taxonomy general name' ), ...
1
vote
1answer
27 views

Redirect all child taxonomy to its parent

Is it possible to automatically redirect a child taxonomy to its parent, therefore not having a public page at all for the child taxonomy? Example: I have a taxonomy called venue, this is set up with '...
0
votes
0answers
15 views

How to use the Term Object from a custom select field in a query

I have a WordPress site in which I want to show 2 recent posts from a specific category. I want to use custom fields (via ACF in this case) to allow the site admin to choose/change the category ...
0
votes
0answers
26 views

ACF Taxonomy field values not select in backend

I created delivery type field using ACF taxonomy. And its working finecheck but I need to add this field in my website product add page. I used some hardcode in my theme funtion.php to show the ...
1
vote
0answers
10 views

Loop through categories and display posts title under each dropdown

I want to loop through categories and display the post's title under each category dropdown. Clicking the post name from the dropdown will display the post content in a tab pane in WordPress. Can ...
1
vote
0answers
8 views

Display tag image in post using Taxonomy Images plugin index.php

I'm a beginner programmer, and I need to display its image along with the tag, how can I do this? Here is the code: <div class="blog-list row"> <?php ...
0
votes
0answers
9 views

Need to print category and subcategory of current post item (Custom post type)

I have a custom post type called products and that have category and subcategory (locations) like Delhi, India Karnataka, India Sharjah, UAE Above are the categories and subcategories(child). Here ...
0
votes
2answers
16 views

display taxonomy terms with link

How can I print the taxonomy terms with links?? This code work but print the terms without link.. some advice?? function show_all_terms($taxonomy){ $taxonomy_terms = get_terms($taxonomy); ...
0
votes
0answers
9 views

Automatically assign taxonomy to all my subcategories

Right now I have this Category 1 > Category 2 I have a list of 300 subcategories that I need to assign to all my Category 2. Is there a way to do that?
0
votes
0answers
18 views

Show taxonomy terms according to post type

I have a global taxonomy called "test taxonomy" and that is used by 3-4 post types (Post Type1, Post Type2, Post Type3, Post Type4...). Some taxonomy (test taxonomy) terms are not used in ...
1
vote
0answers
29 views

New Categories Not Shown In the Post Edit Page

I have a problem with setting up new categories for my new posts. When I publish my second article on the blog, I have created e new category. But when I posted it, the actual category is not showing ...
0
votes
1answer
48 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 ...
0
votes
0answers
16 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-&...
0
votes
0answers
21 views

How to import Countries->States/provinces->Cities as a custom hierarchal taxonomy

I'm building a website where people can upload custom posts on the front end and add countries/cities as a custom taxonomy (location categories) that are easily searchable. I've been able to add all ...
0
votes
0answers
20 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. ...
0
votes
0answers
39 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 ...
0
votes
0answers
21 views

wp_remove_object_terms correct way to call child of parent taxonomy in woocommerce

In Woocommerce I am currently able to assigned and unassign a product category from a product by calling the following. // to assign wp_add_object_terms ( $product_id,'in-stock', 'product_cat' ); //...
1
vote
0answers
20 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 ...
1
vote
0answers
60 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 ...
0
votes
0answers
22 views

How do I filter get_terms() by terms in another taxonomy?

I have a custom post type 'resources' that has two taxonomies 'topic' and 'type'. I want to get the number of each 'topic' with the 'type' of either 'ebook' or 'blog'. This pseudo code is a reflection ...
0
votes
1answer
20 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 ...
0
votes
1answer
34 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 ...
0
votes
0answers
11 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 ...

1
2 3 4 5
38