Skip to main content

Questions tagged [meta-query]

Refers to a mechanism built into the WP_Query class for querying the database for post data, including pages and CPTs, based upon post meta data.

0 votes
0 answers
47 views

I'm displaying three lists of events on my site: past events, current events, and future events. The lists are sorted by a custom date time field. The code I have is currently working, but Wordpress ...
Sam Sabin's user avatar
  • 101
0 votes
1 answer
58 views

I'm trying to create a custom sortable admin column for a custom post type that contains a "repeater" field. The plugin I'm using for this field saves the values as separate entries in the ...
Aayla Secura's user avatar
0 votes
1 answer
70 views

I'm trying to order the woocommerce products by the existence of a specific meta key, in particular: I need to display first the products that have this meta key, and the all the products that doesn't ...
sfarzoso's user avatar
1 vote
1 answer
70 views

I am trying to select records that have a custom field value that matches a search condition but the result is always all records To register the custom field for my post type I am using the following ...
voromax's user avatar
  • 121
1 vote
0 answers
60 views

I have developed a WP Query that displays posts from a custom post type and taxonomy, and orders them by date using a custom field. The posts have a single Advanced Custom Fields date picker field ...
Mike Hermary's user avatar
1 vote
1 answer
239 views

I'm experimenting with a custom query block for the fun of it. I would like to leverage the components that come with core query inner blocks (title, excerpt, featured image, etc..). For this test, I'...
Austin Allen's user avatar
1 vote
1 answer
62 views

I have a field called acf date for certain posts and I need to sort these posts by this field, but the value comes in this format: '20240517' and I need to sort the posts in ascending order with this ...
Yojaimito1's user avatar
0 votes
1 answer
575 views

I have a CPT that contains Employee Bio information. Because we don't want to create accounts in wp_users for everyone, this data is implemented as a "regular" CPT living in wp_posts. Let's ...
scott8035's user avatar
  • 230
0 votes
0 answers
47 views

I'm working with lumber and have custom post types with ACF fields for height and width in decimals. I'm trying to sort my posts first by height and then by width. I am using the following code: // ...
Kari Sletten's user avatar
0 votes
0 answers
57 views

I'm working on a query where I have a few conditions, one of them involving post_date. However, whenever I try to write my query, post_date doesn't return any matches. If I comment that part out, it ...
Nicole's user avatar
  • 1
0 votes
0 answers
214 views

I import products to my woocommerce site, and all the imported products have an category called "external". Note: All the external products have a "_ei_product" meta key with an &...
Sidney Sousa's user avatar
0 votes
1 answer
67 views

I'm trying to order a wp_query using one custom field. It is a radio group with three values: G, S and B (These represent Gold, Silver and Basic). I've been following the documentation and have looked ...
Laurence O'Hare-Carroll's user avatar
0 votes
2 answers
227 views

I am having two custom post type "meet_our_community" and "news" I have added a checkbox field named 'add_to_meet_our_community' from the acf to 'news' post type. Now I when tried ...
Amal's user avatar
  • 11
0 votes
1 answer
71 views

I have created a custom post type service-provider with custom taxonomies region and service-category - By itself, this search works as expected BUT I want to also search on an ACF field. I have an ...
php-b-grader's user avatar
0 votes
1 answer
103 views

There are JSON functions: https://dev.mysql.com/doc/refman/8.3/en/json-search-functions.html can be used to search in complex data with MySQL. In the case of meta keys and values it is an issue that ...
inf3rno's user avatar
  • 135

15 30 50 per page
1
2 3 4 5
71