A
A
ANVARD2014-03-15 13:13:20
PHP
ANVARD, 2014-03-15 13:13:20

Wordpress - why does WP_Query parameter 's' not work?

Wordpress 3.8.1. The Wp_Query "s" parameter does not work, if it is empty, then everything works fine, the answer is empty with it, although there are posts with such data.

What could be the problem? Help me please. Thank you in advance!

Code:
$the_query = new WP_Query(array(
'post_type' => 'events',
's' => $_POST['vars']['eventkeyword'],
'meta_query' => array(
array(
'key' = > 'event_companycity',
'value' => $_POST['vars']['eventcity'],
'compare' => 'LIKE'
)
),
'tax_query' =>
));

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Ruslan, 2014-03-15
@rOOse

And if you remove everything except s? Works or not?

A
ANVARD, 2014-03-15
@ANVARD

left only 's' => $_POST['vars']['eventkeyword'] - articles with type 'post' came out and 's' works (searchs) in them.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question