I have a custom post type, photo
, and need to search for photos matching the title or description with the search keyword with various criteria: contains LIKE
Pass your search string here example like this ( 's'=>'test' )
'test' ) */
$args=array('s'=>'test','order'=> 'DESC', 'posts_per_page'=>get_option('posts_per_page'));
$query=new WP_Query($args);
if( $query->have_posts()):
while( $query->have_posts()): $query->the_post();
{
echo $post->post_title;
echo $post->post_content;
}
endwhile;
else:
endif;
?>