Questions tagged [advanced-taxonomy-queries]
The advanced-taxonomy-queries tag has no usage guidance.
209
questions
0
votes
0
answers
12
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 ...
0
votes
0
answers
60
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 ...
1
vote
2
answers
108
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 ...
0
votes
0
answers
14
views
Categorizing Custom Posts in Bulk Based on Title
I'm working on the website of a client who used pages for every type of content in their not so small website. What they've done is created 400 pages for different projects they have interacted with. ...
0
votes
0
answers
12
views
I want to show a list of posts under specified categories
I want to show a list of post under the category to which posts belong. I have created a custom post name->Post Link and it has a taxonomy->new category and I have also created Advance Fields ...
0
votes
1
answer
32
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 ...
0
votes
0
answers
15
views
Make custom post type display with custom taxonomy in url
I have been attempting to show my products with a custom taxonomy in the url, as such:
[site]/products/product_category/product
Where products is a custom post type, product_category is my custom ...
0
votes
0
answers
46
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 ...
0
votes
1
answer
156
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
...
0
votes
1
answer
19
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,...
0
votes
0
answers
162
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 ...
1
vote
1
answer
47
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 ...
0
votes
1
answer
49
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 ...
0
votes
1
answer
992
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 ...
0
votes
0
answers
137
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.)
...
0
votes
0
answers
16
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 ...
0
votes
1
answer
223
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() ...
1
vote
2
answers
3k
views
ACF: how do I get the fields and its values of a specific group?
<?php $fields = acf_get_fields('6066');
?>
<?php if( $fields )
{
foreach( $fields as $field)
{
$value = get_field( $field['name'] );
if ($value) {
echo '<...
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....
0
votes
0
answers
291
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 ...
5
votes
1
answer
3k
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 ... ...
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, ...
0
votes
1
answer
569
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 "...
1
vote
2
answers
622
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:
...
0
votes
0
answers
278
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 ...
0
votes
1
answer
347
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. ...
1
vote
2
answers
2k
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, ...
1
vote
0
answers
74
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 ...
1
vote
0
answers
690
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
1
answer
41
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 ...
0
votes
1
answer
24
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 ...
0
votes
2
answers
43
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 );
...
0
votes
1
answer
349
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-...
0
votes
0
answers
265
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,...
2
votes
1
answer
280
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 ...
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-...
-1
votes
1
answer
727
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 ...
0
votes
1
answer
53
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(
...
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 ...
0
votes
1
answer
44
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' ...
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 ...
0
votes
1
answer
179
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. ...
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 ...
0
votes
1
answer
753
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
,'...
1
vote
2
answers
54
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 ...
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 ...
8
votes
3
answers
37k
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 ...
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 ...
1
vote
2
answers
270
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 ...
2
votes
1
answer
107
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 [...