Questions tagged [meta-query]

103 questions
0
votes
1 answer

Pre_get_posts meta query filter posts

I'm trying to hide all posts with past date(which is a custom field). I'm doing it with pre_get_posts, but no matter what I do, all pages become 404 not found, and I can't find the problem. Here is the function: function hide_past_events( $query )…
CritingZ
  • 388
  • 2
  • 16
0
votes
1 answer

Meta Query being igored in WP

I am attempting a meta query to get between two prices set as a meta field in my custom post. However the _ccprop_prop_price query is being ignored. Its still giving results higher than 100000 , I can confirm the id of the meta field is…
Adrian
  • 1,976
  • 5
  • 41
  • 105
0
votes
1 answer

How to make wp to compare meta value from associated array

I have used Wordpress meta query with LIKE operator But it displays below kind of characters in my query when I am trying to debug issue: Actual Code (in file): LIKE…
0
votes
0 answers

Sort posts using ACF/post_meta date field, if none set, use post date

Hoping someone can help me! So i’ve created a custom post type, and assigned a date/time selector do it. I have altered the loop to include my custom post type, and want to sort so that if a date is set to a post, then it sorts by that date selected…
0
votes
2 answers

wordpress Wp_query and meta query issue with date field

I have Projects inserted as posts in my WordPress database. currently on my home, the last 3 published project is displayed. now my purpose is that I want first display the project which is expiring today than the last published project. for…
Code Embassy
  • 247
  • 2
  • 16
0
votes
1 answer

Problem with meta query compare event date

I have some problem with my custom post event. I would like to show only events with date is equal or greater than today, but my codes does not work properly and show all events from past and future. My code: Register Custom Post Type in…
ceki10
  • 91
  • 1
  • 13
0
votes
0 answers

WordPress - why is this meta query returning results outside the date query?

I am running a meta query to pull out past custom post types (named 'show') between two dates. The dates are any show between the 1st jan 2000 and 31st dec 2009 $end_2000s = '20091231'; $start_2000s = '20000101'; $row = 1; $args = array( …
Martin
  • 63
  • 2
  • 11
0
votes
0 answers

How to Get query_posts from two 'meta_value' in infinite scroll Wordpress

I am trying to get post by two meta value key, and is working fine in normal page but is not working on infinity. The problem is that, there is no post request received when the page is scrolled. Please see the code below. I have done many search…
0
votes
1 answer

Filtering Data with WP_Meta_Query

I want to search restaurant by their sit capacity. I will select a number from dropdown and I have to show restaurants between minimum and maximum sit capacity. I tried below code. But it always shows no results. $_seating_capacity =…
weaver
  • 453
  • 1
  • 8
  • 21
0
votes
2 answers

ACF checkbox meta query

The below isn't working, can't see why. is_focus_product is a True/False ACF field $ls = get_posts([ 'meta_query' => [ [ 'key' => 'is_focus_product', 'value' => 1, 'compare' => '=' ] ] ]); // array(0){} However…
ggdx
  • 3,024
  • 4
  • 32
  • 48
0
votes
1 answer

Wordpress meta query failing

got this code below and it's not returning any posts I got a custom field named advertentiecategorie, with value 2 in multiple posts array( 'post' ), 'order' => …
quokka
  • 303
  • 3
  • 14
0
votes
1 answer

wordpress order posts by meta_value date in DESC order

I am trying to sort a query to display posts in order of a meta_key value. The value is stored like so: 2018-Mar-23. I would like to display posts with a date that is after today, with the closest date for example 2018-Aug-30 being shown first, and…
danyo
  • 5,686
  • 20
  • 59
  • 119
-2
votes
1 answer

ACF Meta_Query and Get_posts is not working

I am trying to query custom post type but I keep getting no result. Is my meta_query the culprit? What is wrong with this code? I am trying to spot the issues but i cannot find anything. $catname = 'travel'; $priority ='high'; $status =…
OneNation
  • 427
  • 1
  • 8
  • 22
1 2 3 4 5 6
7