Tagged: portfolio grid
I am using the portfolio grid on my page url listed in private. When the portfolio grid moves into mobile view it only displays one item. I have named this view “You may also like,” the thing is that it shows that the prospective client may also like the same portfolio item that they are viewing. Is there any way to exclude a portfolio from the portfolio grid view which could change on each page?
Hey!
Try adding this at the very end of your theme / child theme functions.php file:
add_filter( 'avia_post_grid_query', 'avia_post_grid_query_func', 10, 2);
function avia_post_grid_query_func( $query, $params ) {
if(is_single()) {
$id = get_the_ID();
$query['post__not_in'] = array($id);
}
return $query;
}
Cheers!
Josue
This code worked for the 1st url however not the 2nd url. You will notice if you scroll to the bottom of the page on the 2nd url that there is no portfolio image?
There’s no portfolio item to show on the second link, review the taxonomy settings you have on that element.
Josue,
Thanks I found the issue I did not check the portfolio Categorie on one of the entries.
You are welcome, glad to help :)
Regards,
Josue