Hey,
I have embedded the Magazine Element into a sidebar on a portfolio item page with the intention of displaying other portfolio items that are in the same category. I have selected the do not show duplicates on entire page option however those displayed include the actual portfolio item of the page the user is viewing. Kind of seems pointless to offer an option to view similar portfolios that includes the one of the page we are already on, how would I go about not showing the current item in the list?
Thanks,
James.
Hey jamesbarrell,
Thank you for using Enfold.
Please use this filter in the functions.php file to exclude the current post in the magazine uery.
add_filter('avf_magazine_entries_query','avf_magazine_entries_query_mod', 10, 2);
function avf_magazine_entries_query_mod($query, $params)
{
if(is_singular('portfolio')) {
$query['post__not_in'] = array(avia_get_the_ID());
}
return $query;
}
Best regards,
Ismael
Great thanks