Skip to main content

All Questions

Tagged with
0 votes
0 answers
28 views

Meta_query question

There is a problem with compiling a request to display posts by meta_query. Need to output posts whose title contains a substring. Can't figure out where I'm wrong. Can someone help? $inputValue = '...
Андрей Кочуров's user avatar
0 votes
2 answers
51 views

Need to search a custom field (ingredients, one long string per post), but want it to allow phrases/non-exact matches

So I have a complex list of ACF repeaters for ingredients, but have a save hook to store them all as one comma delimited text string in a custom field to help. My current "advanced" search ...
gokujou's user avatar
  • 101
0 votes
1 answer
60 views

meta_query search names when they have middle initials

I have to build a search form where I search members of the company by their Full Name (First Name + Middle Initial + Last Name). All the names are in this form: John B. Doe The below code is working ...
ari's user avatar
  • 101
0 votes
1 answer
282 views

find custom post type post by searching its custom field with my string

I have a custom post type called series and each post has a custom field named originaltitle. So in my code before I create a new post, I need to check if there is already a "series" with ...
Seddek Iguijji's user avatar
1 vote
1 answer
345 views

Wordpress, fetching users with an exact match in a string of comma separated values in user_meta

I have data saved in user_meta -> areapref field. It is basically a string of comma delimited post IDs (e.g. 2, 37, 200, 300 etc.) I need to check if the user has a particular ID in this field. If ...
Mike Smith's user avatar
0 votes
0 answers
170 views

Multiple WP_Query args combinations according to post type

I'd like to have separate meta_query arguments according to the post type. For example, I'd like to query t-shirts that have a green collar or dress-shirts that have a green inner-lining, right now I ...
martin schwartz's user avatar
2 votes
2 answers
3k views

pre_get_posts and search query for admin

I'm going round in circles with trying to include several custom fields in my search results. The custom fields are managed via ACF. At first I want this for the admin. /wp-admin/edit.php?post_type=...
v3nt's user avatar
  • 1,689
0 votes
3 answers
40 views

Form for search pages by meta datas

Hello I need a form in one wordpress page where an user can search pages by specific meta data. I found how to do search: https://rudrastyh.com/wordpress/meta_query.html#query_meta_values But how ...
Floh's user avatar
  • 1
0 votes
1 answer
152 views

Restrict WordPress search to a single ACF field

I've used the following filter to include an ACF field into my search results. add_filter( 'pre_get_posts', 'so_9224493_adjust_search_query'); function so_9224493_adjust_search_query( $query ) { ...
idleberg's user avatar
  • 157
1 vote
0 answers
30 views

Meta query: How do I return posts within a date period from a given month?

I have posts with a meta start_date and a meta end_date, stored in timestamp format (I can change the format if necessary) I would like to return all posts that have a date in that month by giving a ...
DongMaster's user avatar
0 votes
1 answer
622 views

Issues with search after added meta_query

I'm trying to add to the WP search so it includes some meta fields. Here's my current code in the functions.php which was based of another stack from a few years back: function extend_search_query($...
Jam3sn's user avatar
  • 125
0 votes
2 answers
4k views

Re-order search results with posts_orderby filter and post meta value

I'd like to re-order the search results based on post meta and date . The post meta key is _prioritize_s and the value isn't important. So in a "normal" meta query, I'd just write the compare ...
RachieVee's user avatar
  • 830
1 vote
0 answers
465 views

Extend product search with meta in WooCommerce

I would improve the search bar in order to exploit manufacture attribute linked to product. I try to use this to filter product by a custom meta (no product attribute) function custom_search_query( $...
Claudio Pomo's user avatar
1 vote
1 answer
360 views

How do I have WP_Query match posts based on search parameter OR meta fields? (rather than search parameters AND meta fields)?

I'm trying to include post meta in the scope of a WordPress search using WP_Query. I have a meta query that looks like this: $args['meta_query'] = [ 'relation' => 'AND', [ 'key' =...
Blaine Lafreniere's user avatar
0 votes
1 answer
27 views

How many meta-query fields support WordPress search at a time?

I am new developer. I want know How many meta-query fields support WordPress search at a time? I saw that its getting (500 time out) errors after nine fields.
fiyan's user avatar
  • 21

15 30 50 per page