Skip to main content

Questions tagged [advanced-taxonomy-queries]

Filter by
Sorted by
Tagged with
0 votes
0 answers
12 views

WP_Query on custom taxonomy -> Location and Activity

A store location site displays stores based on region, town OR activity. I am using the WP Store Locator plugin and also using Divi Builder to create the pages. This is proving quite powerful and I ...
Adam Fletcher's user avatar
0 votes
0 answers
12 views

How to clear cache for get_terms()

I am calling get_terms() in a loop. I may modify the terms (add one) in an iteration of the loop. I need to be sure that the next iteration gets this added one. Specifically; I test for a child term ...
Kropotkin's user avatar
  • 169
0 votes
0 answers
26 views

Include custom post type that matches taxonomy field in another custom post type

I have two custom post types, one is “maker” and the other “product”. (used ACF plugin) I have a taxonomy field for Business Name, this field is called “choose_business” in the product custom post ...
Nik Nak Sim's user avatar
0 votes
0 answers
221 views

Sort posts by category and date using php and custom query

I am using Elementor Pro and Advanced Queries and also ACF for custom date. I have 2 types of posts that are events - event 1 and event 2. I have an event calendar on the first page showcasing the ...
Tryandcry's user avatar
1 vote
2 answers
3k views

WordPress - Custom permalinks for advanced custom fields (ACF) using post type taxonomy

I am trying to update the URL structure for posts within a custom post type. I would like the url to use the taxonomy slug from the "resource-topic" taxonomy, and not the custom post type ...
user2748363's user avatar
0 votes
1 answer
44 views

List posts grouped by children of a custom taxonomy

I am successfully listing posts grouped by category from a custom taxonomy like so: Category 1 Post Post Post Category 2 Post Post Post Category 3 Post Post Post Category 4 Post Post Post I am ...
quantum_leap's user avatar
0 votes
0 answers
70 views

Hook to filter based on form value and insert term

I am working on a form where I am trying to insert a term to a taxonomy. So I have a drop down select with a list of my taxonomies and then the next field is a simple text field where the users will ...
spyfly's user avatar
  • 1
0 votes
1 answer
227 views

wp_get_object_terms count on taxonomies within an category archive

Working on a category archive, i have a sidebar with custom non hierarchical taxonomies, used as filters (like custom post_tags). In order to list those filters, I use wp_get_object_terms: <?php ...
rafa226's user avatar
  • 121
0 votes
1 answer
20 views

Incorrect taxonomy ID assigned to post with custom query

I'm having a strange issue where the output of the following query isn't always correct. <?php // Get all the categories $categories = get_terms( 'soort-event', array( 'include' => array( 36,37,...
NielsPilon's user avatar
0 votes
0 answers
194 views

Exclude taxonomy term from list of current taxonomy terms

I am trying to display a list of custom taxonomy terms for the current page, but do not know how to filter out specific terms. My code is below. How do I exclude certain taxonomy terms? I'm still ...
Michelle's user avatar
1 vote
1 answer
303 views

Remove All Taxonomies from Post On Update

I've got a custom post type set up with custom taxonomies. When a user updates a post I need a way to check to see if there are any location taxonomies applied and if so then remove them. I've managed ...
Daniel Worthington's user avatar
0 votes
1 answer
56 views

A function to add arguments to a taxonomy

I use a plugin that adds the taxonomy "Vendors" - but not with arguments I need to be able to use a layout designer (Avada-> Layouts) and assign that layout to all "vendors" I ...
BeTA iT's user avatar
  • 63
0 votes
1 answer
1k views

ACF - Retrieve custom taxonomy from a relationship field

I have a custom post type, called prognosis with 3 custom taxonomies, Country, Competition, and Sport, I've also added a few ACF custom fields. I have another custom post type called analysis with an ...
quantum_leap's user avatar
0 votes
0 answers
161 views

How to get related taxonomies based on a category with mysql query?

I have a lot of custom taxonomies for my WordPress site. What I want to do is to Get Related Custom Taxonomies based on a Category. Sample Structure: (Material, OS and Features are Custom Taxonomies.) ...
cloudinstone's user avatar
0 votes
0 answers
25 views

get terms hiding empty

I have different taxonomies, let's say category and colour, these 2 tax have different terms, the tax are in parallel, a product can be in the category A and have colours X, in my frontend when I go ...
francesco.venica's user avatar
0 votes
1 answer
312 views

Display a list of random terms from custom taxonomy with shortcode

I try to output a list of terms from my custom taxonomy. I am almost sure I was using this code snippet before, but somehow WP throws errors: shuffle() expects parameter 1 to be array array_slice() ...
alstorx's user avatar
  • 51
1 vote
2 answers
5k views

ACF: how do I get the fields and its values of a specific group? [closed]

<?php $fields = acf_get_fields('6066'); ?> <?php if( $fields ) { foreach( $fields as $field) { $value = get_field( $field['name'] ); if ($value) { echo '<...
Johan's user avatar
  • 309
0 votes
1 answer
10 views

Tracking the name of a custom taxonomy

For a site I need to show related posts for a custom taxonomy. Because another person build this site and also created a custom taxonomy, and this code can't be found in a proper file like functions....
Ricardio's user avatar
0 votes
0 answers
303 views

How to do a WP_Query when a post has a relationship to anoter post via an ACF Post Object field, where the related post is in a certain category?

I have custom post type A, and B. B has a relationship back to A via an ACF Post Object field. A has (custom) taxonomies that B does not. How do you get all B where A is in taxonomy X. I imagine how ...
Theo's user avatar
  • 101
5 votes
1 answer
4k views

WP 5.8 "Query Loop" block: where to place custom query?

In the recent wordpress.org article outlining the new Query Loop block, it says the "Inherit query from template" option allows you to "customize the query that the loop relies upon ... ...
Rickmakeitquick's user avatar
0 votes
0 answers
35 views

Add terms to a taxonomy archive from within the same taxonomy

not sure if this is even possible (guessing it should be though)... I have a custom taxomomy of status, containing the following terms... pending, collecting, started, doing, dispatched, delivered, ...
richerimage's user avatar
0 votes
1 answer
680 views

Display related CPT with custom taxonomy

I have two custom post types: "storefront_location" and "services" These are linked by a custom taxonomy "location" I am building a post template for "...
srack's user avatar
  • 1
2 votes
3 answers
1k views

How to get custom taxonomy terms based on another taxonomy?

How to list out all the terms of a custom taxonomy that are relative in another custom taxonomy? I am creating a filter page for a CPT with multiple custom taxonomies. Please see the screenshot below: ...
Atimmy's user avatar
  • 55
0 votes
0 answers
300 views

Tax query get first product with attribute value in pre_get_posts

We've got a webshop with over 3000 products. Some products have the same attribute value for pa_model, as shown below. Productid 1 - pa_model Nike Productid 2 - pa_model Nike Productid 3 - pa_model ...
Theo's user avatar
  • 9
0 votes
1 answer
557 views

Is it possible to filter a taxonomy archive by other taxonomies that are on posts?

Alright. I've worked with Wordpress for more than 10 years. I've never had a need to do this before and I don't think it's actually possible without some pretty custom dev work. So let me set this up. ...
Josh Christopherson's user avatar
1 vote
2 answers
3k views

wp_dropdown_categories and custom taxonomy + custom post type

I have created custom post type called "case study"(with slug case-study), with support of custom taxonomy which is called "theme". What i am trying to achieve? Simple dropdown, ...
Nikson's user avatar
  • 15
1 vote
0 answers
77 views

rewrite URL based on selected taxonomy for post page

I have a taxonomy called "group", and their values like "red", "blue", "green" (these are generating dynamic" no any fixed group value. during post ...
Roshan Jha'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
43 views

Taxonomy archive page listing terms instead of posts

Is it possible to show list of taxonomy terms in archive page instead of the post list? Via modifying the query and not temper with theme templates? I have a taxonomy archive that I want to display ...
AVJ's user avatar
  • 3
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
2 answers
45 views

Custom post type query with taxonomy

I use this query to call posts from a custom-type post I setup apart $args = array( 'posts_per_page' => 5, 'order'=> 'DES', 'post_type' => 'custom-post' ); $myposts = get_posts( $args ); ...
PaoloPgn's user avatar
0 votes
1 answer
419 views

How to get_term_meta on single custom post?

I added custom image and icon to my custom taxonomy, and I know how to display it in the front end in the taxonomy template page. $headImageId = get_term_meta( get_queried_object_id(), 'category-...
artist learning to code's user avatar
0 votes
0 answers
275 views

wp_query with meta_query and tax_query

I am trying to find a way to combine a meta_query and a term_query and i got confused with the research. $sport = 'basket'; $args_p = array( 'posts_per_page' => 10,...
Kap40's user avatar
  • 1
2 votes
1 answer
347 views

Get image of latest post from taxonomies/categories

I have a custom post type "Artworks" with a custom taxonomy "Artists". I have a page where I list all the entries from the "Artists" taxonomy (Artist 1, Artist 2, Artist 3, etc.). How can I get the ...
HAL2020's user avatar
  • 39
0 votes
1 answer
63 views

Custom Taxonomies Archive Page 404

I used the "Custom Post Types UI" and "Custom Fields" plug-ins to set up my structure. I have a custom post type called "artwork". This works fine. Posts have URLs like domain.cc/artwork/title-of-...
HAL2020's user avatar
  • 39
-1 votes
1 answer
770 views

Display Custom Field or Custom Taxonomy in front page /post/product

I added some custom field and taxonomy in post /page/product main like Type, Channels, Battery etc.I created with custom post type UI plugin & ACF plugin but it is not showing in frontend of post ...
learning wordpress's user avatar
0 votes
1 answer
67 views

WP_Query not using custom taxonomy categories on custom post type

So I have both a custom post type which is called 'Recipes' in my register method() as shown below: public static function register() { add_action('init', function() { $labels = array( ...
DevSem's user avatar
  • 209
1 vote
0 answers
29 views

Taxonomies on custom taxonomies

I have a custom post type with multiple custom taxonomies. I need those taxonomies to have a relationship as well. The trick is, I need a child to be able to have multiple parents. I understand that ...
John McCulley's user avatar
0 votes
1 answer
49 views

Search for single post by 2 tags

i have "Tag1" and "Tag2" i want to find most recent post with both tags.So far i have tried this, i know im close, but it is listing all posts containing either tag. $args = array( 'relation' ...
Onelostpuppy's user avatar
0 votes
1 answer
1k views

Get queried object for custom post type count

$posts = get_queried_object(); echo $posts->count; I can get post count with this code in taxonomy archive page . problem is that i can not specify post type. i just want count only A custom post ...
Gidromasservis QSC's user avatar
0 votes
1 answer
182 views

list all post who have mutual taxonomy as current taxonomy!

I have app archive site with two different taxonomy type: Seller and Kind, I want to have a page for every seller and inside that page, I want to have multiple lists for every term of "Kind" taxonomy. ...
ErfanMHD's user avatar
0 votes
1 answer
4k views

Loop through ACF taxonomies and output associated posts

I have a page template that loops through all existing post categories and outputs 5 associated posts for each category. I want to change this so it only outputs the categories I have selected in an ...
user108167's user avatar
0 votes
1 answer
824 views

Why pagination is not working with tax_query param?

this is my query: $p_query = new WP_Query(array( 'post_type' => $post_type ,'post_status' => 'publish' ,'posts_per_page' => $per_page // 6 ,'paged' => $page // 2 ,'...
Luca Reghellin's user avatar
1 vote
2 answers
59 views

How do I get a list of all categories that a given user has written blog posts for?

I need to retrieve the name of all the categories that a given user has published posts for. If I can also get a URL for the archive of that cat for that user only, this would make me very happy. How ...
Matthew Brown aka Lord Matt's user avatar
0 votes
0 answers
46 views

Wordpress taxonomy terms archive template help

I have custom post type Named Trips , Taxonomy > Destination , Region Activity Etc. Region Terms are , Annapurna , Everest etc. Activity Terms are trek, hiking, tours etc. I made an archive template ...
Suraz Bhandari's user avatar
10 votes
3 answers
40k views

Get url of product's images (woocommerce)

What happen when a post (product) didnt have a guid,because it has the same image with another product ? For example: Query1: select guid from wp_posts where post_type='attachment' and ...
user8761967's user avatar
0 votes
0 answers
78 views

Permalink URL connection between two custom types

We use latest WP 5.2, and the super plugins Advanced Custom Fields Pro (ACF Pro) and CPT UI. In our website taxonomy, we need to have events, within which we have talks and workshops. Example ...
Khom Nazid's user avatar
1 vote
2 answers
273 views

Shortcode to show thumbnail and link for 3 random posts

I want to have a small header at the top of a page showing the featured images with a link to the related custom post type. This is my code: // Creates random image header within tax called(defaults ...
rudtek's user avatar
  • 6,143
2 votes
1 answer
127 views

get complex results set according to category structure

I need to get a complex result set from a WordPress database according to the category structure. First I will try to explain my category structure. I have three level structure as bellow. flight [...
Janith Chinthana's user avatar
0 votes
1 answer
924 views

Custom taxonomy.php not working

I have created a custom taxonomy called "series" (code below) and two pages: taxonomy.php and a taxonomy-series.php 1)I noticed that siteurl.com/series does not work I get my 404 page, but if I were ...
user5854648's user avatar

1
2 3 4 5