I want to search WordPress custom post type by post_title and i am using
$spot_args = array(
"post_type" => "spot",
"post_status" => "publish",
"posts_per_page" => -1,
"meta_query" => $meta_build //array that contain meta condition
);
$wp_query = new WP_Query($spot_args);
Now how to add filter for post_title, Not effect of using
add_filter('posts_where', 'post_title_condition');
function post_title_condition($where) {
global $wpdb;
where .= ' OR ' . $wpdb->posts . 'post_title LIKE %' . $title. '% ';
$where;
}
so any way ??
Try this
Happy Coding :)
Try this
use mysql query like this: