Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #836237

    Hi,
    On a single portfolio item page, I also have the portfolio grid showing related portfolio items. However, it pulls the same portfolio item that I’m currently on. This problem was brought up already in this post – https://kriesi.at/support/topic/remove-current-portfolio-post-from-related-portfolio-grid-enfold/. However the solution specified in the post doesn’t work – it simply seems to be removing the first portfolio item from the grid regardless of which portfolio item I’m on.
    This is what I tried, according to the post mentioned above –

    function ava_exclude_portfolio($query) {
    	if (is_singular('portfolio')) {
    		$query->set( 'offset', '1' );
    	}
    }
    
    add_action('pre_get_posts', 'ava_exclude_portfolio');

    Pls let me know if I’m missing anything here?

    #836906

    Hey eric-kfa,

    Here is the code you can put in your funtions.php

    
    /*filter portfolio sorting */
    add_filter('avia_post_grid_query', 'avf_custom_post_grid_query');
    
    function avf_custom_post_grid_query ( $query ) {
      if(is_singular('portfolio')) {
      	global $post;
    
      	$query['post__not_in'] = array($post->id);
      }
      return $query;
    }
    

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #837335

    Hi Victoria,
    This still doesn’t work. It shows me the same portfolio item in the grid as the one I’m currently on.
    Could you please take a look?

    #838049

    Hi eric-kfa,

    Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?
    It show different items to me. Look in private.

    Best regards,
    Victoria

    #838180

    Sorry, it looks different because I added more posts. The portfolio grid always picks up the latest posts, so since I added newer ones, it shows newer items. So now for instance you can see the repeat happening for the link I shared below.
    Also sharing the temp access for our server.

    #838877

    Hi, any updates?

    #839272

    Hi eric-kfa,

    The code above does not work, because those are not portfolios, those are teachings “single single-teaching”.
    Can you give that account admin rights? Is that a plugin?

    Best regards,
    Victoria

    #1028592

    Just tried this code…can confirm it does not work.

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