Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #527869

    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?

    #527871

    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

    #527947

    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?

    #527980

    There’s no portfolio item to show on the second link, review the taxonomy settings you have on that element.

    #528001

    Josue,

    Thanks I found the issue I did not check the portfolio Categorie on one of the entries.

    #528005

    You are welcome, glad to help :)

    Regards,
    Josue

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.