if ($_GET['bsearch']) {
$s = $_GET['bsearch'];
$params = array(
's' => $s,
'post_type' => 'post'
);
$post_query = new WP_Query($params);
while ( $post_query->have_posts() ) {
$post_query->the_post();
$result['own'][] = get_post();
print_r($post_query->post->post_title);
}
$post_query->reset_postdata();
}
$s = $_GET['bsearch'];
$params = array(
's' => $s,
'post_type' => 'post'
);
$post_query = new WP_Query($params);
while ( $post_query->have_posts() ) {
$post_query->the_post();
$result['own'][] = get_post();
print_r($post_query->post->post_title);
}
$post_query->reset_postdata();
}
No comments:
Post a Comment