Hi Matthieu,
I am newbie in WP but i had the some problem and locked into the plugin code. I have changed pre_get_posts function and worked for me. Hope this can help.
ps. Sovit thanks for your plugin – it’s very intuitive for the End user
function pre_get_posts( $query )
{
if ( !is_admin() ) {
if ( $query->get( 'featured' ) == 'yes' ) {
$query->set( 'meta_key', 'featured' );
$query->set( 'meta_value', 'yes' );
}
else if ( $query->get( 'featured' ) == 'no' ) {
$metaquery = array(
'relation' => 'OR',
array(
'key' => 'featured',
'value' => 'yes',
'compare' => '!='
),
array(
'key' => 'featured',
'value' => '',
'compare' => 'NOT EXISTS'
)
);
$query->set( 'meta_query', $metaquery );
}
}
return $query;
}