Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1428657

    Hi

    Masonry shows all blog posts from the selected group. The problem I have is that Masonry also shows the post I am on.

    Example: If I am on “Post1” I want Masonry to only show Post2 and Post3. Not “Post1”

    Can this be defined?

    Thanks

    #1428682

    try this in your child-theme functions.php:

    function ava_exclude_current_post($query) {
      if (is_singular('post') || is_singular('portfolio') ) {  
        $exclude = avia_get_the_ID();
        $query->set( 'post__not_in', array($exclude) );
      }
    }
    add_action('pre_get_posts', 'ava_exclude_current_post');

    you can use as if clause instead:

      if(is_single()){  …
    
    #1428689

    It works.
    nice…
    thank you. ;-)

    #1428705

    Hi solf,

    I’m glad that @Guenni007 could help you :)
    Thanks for using Enfold and have a great day!


    @Guenni007
    thanks for helping out :)

    Best regards,
    Nikko

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Do not show axtually post in Masonry’ is closed to new replies.