Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [advanced-taxonomy-queries]

1
vote
2answers
27 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
1answer
40 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 [...
0
votes
1answer
32 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 ...
0
votes
2answers
41 views

one post per term taxonomy

I need some help, again. I use this query: $tax = get_the_terms($id, 'coupon_category'); $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ...
1
vote
2answers
28 views

Wordpress loop: Show only a Custom Post Type Taxononmy TERM

Before I start, I have to say that I have tried to solve my problem in a thousand different ways and I have read several posts without success. I have a CPT called "grouped", a taxonomy for that CPT ...
1
vote
1answer
383 views

WP_Query use for a filter with multiple Taxonomies and Terms

So, what I'm trying to do, is to make an ajax filter, this is the portion of the filter code that builds the $args based on the data that came from the filter form, and afterwards (not in this code) ...
1
vote
0answers
15 views

Help with Taxonomies

I have a site about London that lists a wide range of attractions. This is the current setup. I use standard post with categories for attractions, I have also create some custom taxonomies for the ...
2
votes
2answers
608 views

How can I display all post IDs from the taxonomy?

I try echo on any page (I mean page on my site) all post IDs what I have in my taxonomy. I found this: get a list of posts from Custom Taxonomy But I could not handle with it. I want to echo all ...
0
votes
0answers
60 views

wp_get_post_terms() not returning values for logged out users

I've encountered an issue where wp_get_post_terms() is returning values for logged in users only, but not logged out users (incognito window, other browser, etc). I'm trying to get the values from ...
0
votes
0answers
53 views

How to create multiple parameter archive pages (i.e. something like /$post_type/$taxonomy/$term/)?

Basically, I have three custom post types: videos, news, & reports and a couple custom taxonomies: region & blog — that I'd like to create "sub-archives" for, using the following structure: /$...
3
votes
1answer
3k views

Is it possible to add custom fields to a WooCommerce attribute term? [closed]

On Wordpress / WooCommerce, is it possible to add custom fields to a WooCommerce attribute term? With "attributes" I mean the general attributes and not the attributes under products. Please, check ...
0
votes
1answer
26 views

I need posts within a taxonomy category that are tagged “featured” to show up first

I need posts within a taxonomy category that are tagged “featured” to show up first https://yoga.gcclients.com/listing-category/bucks-county/ Right now it’s pulling posts from ALL posts within the ...
1
vote
1answer
28 views

Query Custom Post Type Order By Taxonomy Field

This is driving me nuts. I know it's been asked a number of times but I can't figure it out. I'm trying to display a list of WooCommerce products--which are a custom post type of 'product'. I want to ...
0
votes
1answer
131 views

Query Custom Post Type by Taxonomy Meta Value

I need to filter my custom post type "events" by Taxonomy Meta Field "city". But I can't make it work and need some help? This is what I already have. But no results... function aa_pre_get_posts($...
0
votes
1answer
52 views

Taxonomy archive, categorised by other taxonomy, not hiding empty taxonomies

Info about my setup: I have a custom post type called 'Treatments' Each treatment is categorised in to up to 3 taxonomy types - treatment categories - 'beautysalon' 'skinclicnic' 'spadays' and these ...
1
vote
1answer
28 views

Add Custom Taxonomy for Blog Meta Info

Apologies but I'm not quite sure how to title this post. When my custom taxonomies are searched nothing shows up after "Posted In" I'm not sure how to go about adding it the categories php below. ...
1
vote
0answers
1k views

add custom filters to the event calendar plugin programatically to frontend [closed]

I want to add custom filters to the filter bar of the event calendar. I have added two dropdown as categories and location programtically, when I submit the selected filters to find events, it gives ...
2
votes
0answers
53 views

How to display custom taxonomy in multiple columns?

I have a custom taxonomy (with terms that include all 50 states) that I'm displaying, along with the title of the posts in that term directly below. Simple, and it's working as expected. However, ...
0
votes
1answer
29 views

Get a Taxonomy values in an array

I have a Taxonomy type named: Products:product_cat I need the term names inside this field in an array. Is there any way to get them?
0
votes
1answer
39 views

Showing taxonomies with terms that are attached to custom post

So, I have to show the taxonomies that are present on a custom post, with their terms. I have some taxonomies (around 10) and all of them have a few terms. Eacho post can have any number of ...
0
votes
1answer
34 views

Getting all custom post taxonomies and exhibiting only part of them

I have a custom post type, that has several taxonomies. For each one, I need to show something like: Taxonomy name: Taxonomy value So, since I have posts that have the following taxonomy tree: ...
0
votes
2answers
3k views

Getting taxonomy category Image from ACF [closed]

I'm really new to php and I'm trying to get an image set using advanced custom fields on my front end. I've looked at the docs and forums but I can't get the url. All the code works but for the image. ...
0
votes
1answer
76 views

Complex Taxonomy scheme

We are building a resorts site and we're facing a huge taxonomy problem. On one side, we have administrative locations such as country>>region>>department and "natural" locations, such as mountain-...
1
vote
2answers
328 views

How to conditionally redirect to the post from a taxonomy page?

I would like to redirect to a post if the taxonomy term it belongs to has only one post assigned to it and so far I have this: $term_id = get_queried_object()->term_id; $taxonomy_name = '...
0
votes
2answers
1k views

Show only the sub-categories (and their content) of the current custom taxonomy with 'taxonomy.php'

So, I need to show a page with the sub-categories of the current custom taxonomy, with their respective posts inside. What I need is, when I click on a sub-cat link, I get something like: 'Tipos' (...
0
votes
2answers
509 views

Sorting taxonomy columns by meta value numeric

Slowly going crazy over trying to make taxonomy admin columns sortable by a custom field number. I have a custom taxonomy called "typer" and these taxonomies have a custom field called "prioritet". ...
0
votes
0answers
73 views

Error get_posts with Custom Taxonomy and OR relation

I've been stuck on this for hours... I did a var_dump($list_items) right before if ( $list_items ) { and it turns up empty, but a var_dump($hold_tax_query) looks (to me) like it should. if($...
0
votes
0answers
89 views

Taxonomy On Index Page

I cannot find the way to show my "taxonomy in the index", i don't know how i can display the post, not by default , if not for my taxonomy. Anyone can help me? add_filter( 'pre_get_post', '...
0
votes
0answers
165 views

Combine Tax Archive and Meta_Query in WP_Query

Is there a way to instantiate a WP_Query object—filtered by post_meta and taxonomy_meta—within the loop of which I can have access to both post and taxonomy-archive methods (like the_excerpt and ...
0
votes
0answers
31 views

Taxonomy Terms That Don't Exist Display Results

I am working on a custom post type with an archive at: https://www.bowlertransmissions.com/mmc/ If you click one of the results years, such as '2016' you will then get to a page with two buttons to ...
0
votes
1answer
116 views

How to show only tagged CPT categories / taxonomies for a custom post type?

The code below is echoing all the taxonomies available for the particular CPT. I'm calling this in a single-posttype.php to show taxonomies. What I need is to display only the taxonomies tagged to the ...
0
votes
2answers
2k views

Get taxonomy url, name, post count & image

I'm attempting to display a specific taxonomy (channel) in the archive.php page. I want to display the taxonomy's URL, name, post count, and taxonomy image. This is what I have that's working so far: ...
-1
votes
1answer
729 views

Output ACF field dynamicaly within a taxonomy loop [closed]

So I have this block that loops over my taxonomies and loads a template file to display each one of them while in it: <?php $collections = get_terms( 'resource-collection', array( 'orderby' ...
3
votes
1answer
45 views

Related Tags Concept

On search results pages I would like to show a tag list collected from other posts that are listed for the seach result. // same tag should not be listed twice And for the taxonomy pages again; tags ...
1
vote
0answers
5 views

Enable users to change change and add taxonomies of posts

I would like to enable users to add tags/categories, and to vote for tags/catergories for each post It would be a simple voting system : each user can vote for each tags (+1 / -1) and only tags that ...
0
votes
1answer
2k views

Using Advanced Custom Fields Relationship Field to select a taxonomy term

I have a site where I've got a post type called 'small banners' which are basically adverts that i need to call on normal pages (This is fine, I've done this) but I also need to use this functionality ...
-1
votes
1answer
866 views

Get taxonomy image for Toolset custom taxonomy through Toolset Views Shortcode

I'm using Toolset Views to display a list of taxonomies. These taxonomies are under a custom Taxonomy that I created with Toolset Taxonomies. I then used the plugin Taxonomy Images to add the option ...
0
votes
1answer
116 views

How to replace hard-coded list of custom taxonomy terms based on custom field query [closed]

I am currently hard-coding custom taxonomy terms "13329,5555" into a block of code. Instead of hard-coding the custom taxonomy product_cat term_id as "13329,5555" how would I dynamically replace 13329,...
0
votes
1answer
145 views

In Product Category archives how to show Posts having same/similar prod_cat slug structure?

I will be writing Posts about each of Product's Product Categories (product_cat on products) and I am choosing to group (associate) Posts by the product_cat hierarchical taxonomy. To do this without ...
0
votes
1answer
27 views

Make relation of custom taxomies

Need to make a relation of two different custom taxomonies. Example: Sport category with subcategory basketball. Just like that I have team and player taxonomy. I am looking for linking a player with ...
0
votes
1answer
301 views

Return an array from get_terms and store as JavaScript array for search autocomplete

I am trying to use wp_list_pluck to return an array of taxonomy names from get_terms. I'm not sure what I'm doing wrong, but this only echo's out "Array": $terms = get_terms(array( 'taxonomy' ...
2
votes
1answer
826 views

tax_query shows no results if nothing is selected

I am creating a real estate website on WordPress, I am creating a custom search and am using tax_query to filter search results to display "States" & "Suburbs". The search works fine, when ...
0
votes
1answer
29 views

modifying main query to query for ranges e.g. from 1999 to 2016

I've taxonomy _year and I'm modifying main query by hooking into pre_get_posts action. My code looks like this: if ( ! empty( $_GET['mt-from-year'] ) ) { $from_year = ...
1
vote
1answer
861 views

WP_Query tax_query on ACF post_object

I have a custom post type Wine, which has an ACF Field that links to another custom post type Producer as a post_object relation. In my Producer, I have a custom taxonomy named Region. Now, what I'm ...
1
vote
1answer
379 views

Fetch all terms for an array of posts

I need to fetch all terms associated with an array of posts. I can loop over each post and do a seperate get_terms or wp_get_post_terms query for each post but that seems like a really slow way of ...
0
votes
1answer
1k views

get all posts associated with a custom taxonomy

Looks like the advanced tax query options in WordPress does not allow the following query: Get me the most recent posts but only those posts that have at least one term under the taxonomy I'm ...
0
votes
2answers
519 views

get_the_terms error

I'm using the CPT-onomies plugin to make a CPT into a taxonomy. I have a hero image CPT (created with CPT-onomies) and the hero images post type is attached to the page post type. This allows me to ...
0
votes
1answer
31 views

Best Plugins for Complex Index of Resources [closed]

The title might seem a little redundant, but I was wondering if anyone has any recommendations on creating a complex relational database using Custom Post Types (CPTs). I know (theoretically) how to ...
2
votes
3answers
1k views

Custom taxonomy template not working with simple loop. Multiple CPT using the same taxonomy

I need help with WP custom taxonomy and custom post types. I never find a working solution so far. Please accept my apologies if this has a simple solution. I tried my best to find solution everywhere ...
1
vote
1answer
590 views

Combining categories (Query posts with multiple taxonomy terms)

I'm attempting to display a list of all posts from multiple categories (if anyone answers this, you might want to include combining tags as well, as probably that will make this answer comprehensive ...