Last active
January 15, 2016 03:32
-
-
Save jchristopher/9486b9a6145bdaea16eb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$swp_query = new SWP_Query( | |
array( | |
's' => 'coffee', // search query | |
'engine' => 'default', // engine to use | |
'post_type' => array(), // override enabled post types in engine config (SearchWP 2.7+) | |
'posts_per_page' => 10, // posts per page | |
'nopaging' => false, // disable paging? | |
'fields' => 'all', // set to 'ids' to return only post IDs (SearchWP 2.7+) | |
'page' => 1, // which page of results | |
'post__in' => array(), // limit potential results pool to array of IDs | |
'post__not_in' => array(), // explicity exclude IDs from search results | |
'tax_query' => array( // tax_query support | |
array( | |
'taxonomy' => 'people', | |
'field' => 'slug', | |
'terms' => 'bob', | |
), | |
), | |
'meta_query' => array( // meta_query support | |
array( | |
'key' => 'age', | |
'value' => array( 3, 4 ), | |
'compare' => 'IN', | |
), | |
), | |
'date_query' => array( // date_query support | |
array( | |
'year' => 2015, | |
'month' => 6, | |
'day' => 1, | |
), | |
), | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment