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

    Hello
    We have a page that displays all posts from 4 categories: a b c d
    When you click a post from Category b – you see that post and on the bottom of the post – a section with a post grid titled “See more from this category b”

    But we do not want to show the current post that you are on in that slider/grid.
    Any ideas?

    #727424

    Hey reddishpinkmedia,

    Could you post a link to the site in question so that we can take a closer look please?

    Best regards,
    Rikard

    #727570

    Sure – you can see a case study in a section called Education.

    We have a blog grid below that listing ALL from education. But we don’t want to show the current blog post in that list – doesn’t make sense.

    Thanks
    Jeff

    #728307

    Hi Jeff,

    Please use Blog Posts element instead of Masonry element and edit the element and set the “Offset Number” to not allow duplicate posts.

    Enjoy your holidays!

    Best regards,
    Yigit

    #729598

    Hi there
    This didnt seem to work – I set the post grid to not allow duplicate posts on the entire page (set offset automatically)

    I see the post im on as the first item in the list. Scroll down to -> OTHER CONSTRUCTION PROJECTS YOU MIGHT BE INTERESTED IN
    And the first post is the current page.

    Any ideas?
    Thanks!

    #730166

    Hi,

    Try adding this code in functions.php:

    add_filter('avia_masonry_entries_query', 'avia_masonry_custom_query');
    
    function avia_masonry_custom_query( $query ) {
      global $post;
      $exclude_ids = array('post__not_in' => array($post->ID));
      $query = array_merge((array)$exclude_ids, (array)$query);
      return $query;
    }

    Let us know if this helps :)

    Best regards,
    Nikko

    #731345

    Hi Nikko
    Thanks but I got this error:
    Parse error: syntax error, unexpected ‘=’, expecting ‘)’ in /home/frankly/public_html/sib/wp-content/themes/enfold-child/functions.php on line 49

    #731453

    Hi,

    Try copying the code here: http://pastebin.com/kQrHJ74L if that doesn’t work, can you give us an ftp access to your site? just post the details in the “private content” section.

    Cheers!
    Nikko

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