Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
"wp-query" ambiguously refers to one of two things. 1) WP_Query is a class native to WordPress which allows users to query the posts database using a number of criteria. 2) $wp_query is the global variable that holds the main query object prepared by WordPress based on a given request.
0
votes
1
answer
1k
views
wp_query posts with custom fields number smaller than
Posts have a custom field with key time and a value. In a template I want to query the posts that have the time key and a value smaller than 30. Whatever I have done so far didn't work.
Below is the …
1
vote
wp_query posts with custom fields number smaller than
The args are wrong. The correct code is:
$args = array(
'post_type' => 'post',
'meta_key' => 'time',
'meta_value' => '30',
'meta_compare' => '<',
);
The data is stored as strings and not as numbers …
1
vote
1
answer
472
views
Query all posts if multiple meta key don't exist
I'm trying to get all posts that don't have a meta ket that starts with aa_. I can do it this way
$args = array(
'posts_per_page' => -1,
'category__in' => 23,
'meta_query' => array(
'relation' => 'AN …