After Milo’s help I found a function where it altered the search query:
if( is_search() && empty($_GET['post_type']) && !is_admin() ) {
global $wpdb;
$query = get_search_query();
$query = $wpdb->esc_like( $query );
$where .= " OR {$wpdb->posts}.ID IN (";
$where .= "SELECT {$wpdb->postmeta}.post_id ";
$where .= "FROM {$wpdb->posts}, {$wpdb->postmeta} ";
$where .= "WHERE {$wpdb->posts}.post_type="page" ";<-page to post
$where .= "AND {$wpdb->posts}.post_status="publish" ";
$where .= "AND {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id ";
$where .= "AND {$wpdb->postmeta}.meta_key IN('above-sidebar', 'content-with-sidebar', 'below-sidebar') ";
$where .= "AND {$wpdb->postmeta}.meta_value LIKE '%$query%' )";
}
return $where;
I changed post_type=”page” to ‘post’ and now it works perfectly.
Thanks again, Milo!
Cheers