Can I excluded this portfolio item http://www.aurelwireless.com/nuovo/prodotto/copiatore-tx-4m-cp/ from porfolio grid below ?
Hey unicaweb,
I am getting “Nessun risultato”, have you figured it out already? :)
Best regards,
Yigit
Sorry try this item http://www.aurelwireless.com/nuovo/prodotto/ricetrasmettitore-xtr-8lr10-smd you can see same item repeated in portfolio grid below.
It is possible do not have item again but only other of this category
Hi,
Thank you for the link. Please use the code provided in the following link but remove the third conditional statement: https://kriesi.at/support/topic/prevent-current-pageitem-from-appearing-in-sidebar-widget/#post-593247
add_action('pre_get_posts', 'ava_exclude_widget_post');
function ava_exclude_widget_post($query) {
if (!is_admin() && is_singular('portfolio')) {
$exclude = avia_get_the_ID();
$query->set( 'post__not_in', array($exclude) );
}
}
If this is not working, use this:
//portfolio query
add_filter( 'avia_post_grid_query', 'custom_post_grid_query', 10, 2);
function custom_post_grid_query( $query, $params ) {
$id = avia_get_the_ID();
$query['post__not_in'] = array($id);
return $query;
}
Best regards,
Ismael