Questions tagged [meta-query]
103 questions
1
vote
1 answer
WordPress meta query check the current users in meta value array
I am having trouble to query cpt for the current user if s/he is in the meta value array.
query args
$args = [
'post_type' => $cp::get_module_cpt(),
'posts_per_page' => - 1,
'meta_query' => [
'relation' => 'AND',
…

Code Lover
- 8,099
- 20
- 84
- 154
1
vote
2 answers
How do I use tax_query and meta_query together?
I've got a custom post type called 'jobs' with a taxonomy called 'job-status'.
I'm trying to display a list of jobs with a certain tax term (job-complete) that haven't got a report uploaded to them in a file ACF field type.
The first part works;…

Charlie McCluskey
- 92
- 2
- 10
1
vote
1 answer
How can I order a wp_query with date and then time
I am using Advanced custom fields with separate date and time fields for events. What I need to do is show all the events that haven't yet occurred.
I have managed to show the events in order by date so far but what I need to do now is now have each…

Mark Feltwell
- 13
- 4
1
vote
1 answer
Posts are not sorting based on the meta key values
Custom meta query is not sorting the posts correctly by meta keys. If I have subscription type then those posts should come first after that the posts for those meta key is not exist.
I am trying the below code but it is not working…

kristen
- 21
- 4
1
vote
1 answer
Get list of values, then all post titles with that value
I have a working wordpress loop which displays all posts of a certain meta_query value. The only issue is that the values are repeated. For example, if I have two posts with the value "Blue" then both posts appear in the loop, which makes "Blue"…

BlueHelmet
- 511
- 2
- 5
- 18
1
vote
2 answers
How to add filter to meta_query like finding only Roma Numeric
I have some situational problem with meta_query. Customer Search IV, but result is included prIVate (original word is private). I want to show only IV (roma numeric) included post. My meta_query search from Title, sub title and description in Custom…

Bayanaa
- 53
- 9
1
vote
1 answer
How to orderby meta_key acf field populated with currency symbol and digits?
I'm Querying listings(custom post type) using WP_Query and ordering results by ACF meta field. The field contains price values with the currency symbol and comma separations like $100,000.
Here is the $args I'm passing to the WP_Query.
$args =…

draz umar
- 11
- 2
1
vote
1 answer
Wordpress - WP Query : meta_query relation ignored
I need help with a WP_Query. I use the meta query argument using the OR and AND relations, but this argument seems to be ignored in the result of the query.
Here is my code :
$args = array(
'orderby' => 'date',
'order' …

Nicolas J
- 43
- 1
- 10
1
vote
1 answer
Meta Query Returns Nothing when Too Much Data
I am doing a "find dealer" lookup for a company so that users can put in a zip code and a radius and find all the dealers within that radius.
It seems to work fine until I get a couple thousand zip codes.
I am passing in the array of zip codes to a…

Nate Beers
- 1,355
- 2
- 13
- 22
0
votes
1 answer
another meta_query in pre_get_posts() that returns 0 results
For years I've been using stack overflow and I could always find an answer (or half answers that I could stitch together), but this time I really can't figure this out...
So, I have an ACF Post Object field (inicia_areas) that associates one or more…

Pedro
- 3
- 3
0
votes
0 answers
WP_Query not returning meta values
I have the following code but it is only returning the latest 6 post instead of the conditions in the meta query. What am I doing wrong that it is ignoring the meta_query?
I have tried different conditions as well and still only the latest 6 posts…

user3098629
- 175
- 1
- 1
- 13
0
votes
0 answers
Display available properties first and then sold properties in the end with the increasing price
There is a custom field of property status that contains dropdown of available and sold.
I want to display available properties first with the increasing price order and then sold properties with the same order.
Below is the code but it is not…

Muneeba Faheem
- 1
- 3
0
votes
0 answers
Getting zero record in user meta data in wordpress
I am trying to get user list with specifice role and who is register between two date. I tried But getting zero record (**it has record in database **)in result.
$meta_query = array('relation' => 'AND');
if(isset($_GET['interviewr'])) {
…

Tushal Bhanderi
- 128
- 2
- 16
0
votes
0 answers
ACF Nested Realationship Meta Query
Custom Post Types:
vendor
solution
appointment
Each appointment has a relationship field vendor_solution that's connected a vendor to an appointment. A user is attached to a vendor by way of a user_vendor custom field.
I need to be able to get all…

dcolumbus
- 9,596
- 26
- 100
- 165
0
votes
0 answers
Custom FacetWP dropdown not showing posts
I have been able to render a dropdown facet in FacetWP front end with:
add_filter( 'facetwp_facet_html', function( $output, $params ) {
if ( 'today_or_month' == $params['facet']['name'] ) {
$selected = isset( $params['selected'] ) ?…

ddesigns
- 1