add_filter('wpv_filter_query', 'func_filter_by_title', 10, 2);
function func_filter_by_title($query, $setting) {
global $wpdb;
if($setting['view_id'] == 9999) {
if(isset($_GET['wpvalphabet']) and $_GET['wpvalphabet']!='' ){
$first_char = $_GET['wpvalphabet'];
$postids = $wpdb->get_col($wpdb->prepare("SELECT ID
FROM $wpdb->posts
WHERE SUBSTR($wpdb->posts.post_title,1,1) = %s
AND post_type = '".$query['post_type'][0]."'
AND post_status = 'publish'
ORDER BY $wpdb->posts.post_title",$first_char));
$query['post__in'] = $postids;
}
}
return $query;
}