Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
SWP_Query Loop syntax
$swp_query = new SWP_Query( array( 's' => 'coffee' ) );
if ( $swp_query->have_posts() ) {
while ( $swp_query->have_posts() ) {
get_template_part( 'content', 'search' );
} else {
echo '<p>No results found!</p>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.