Tagged: ,

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

    Hi,

    I’m using masonry for creating “Related posts” section in the bottom of blog posts. Is it possible to prevent it from showing the very same blog post where masonry is placed?

    Also, is there a way to choose specific posts to show in each masonry?

    Thank you in advance!

    Regards,
    Artem

    • This topic was modified 5 years, 8 months ago by artemtik.
    #1076773

    Hey artemtik,

    Unfortunately, it would require quite some time and customization of the theme to achieve this, so I am sorry to tell you that this is not covered by our support. However, if it’s really important for you to get this done, you can always hire a freelancer to do the job for you :)

    Best regards,
    Basilis

    #1078203

    Hi Basilis,

    Got it, thank you for reply! ;)

    Regards,
    Artem

    #1079881

    Hi,

    This filter might help.

    add_filter('avia_masonry_entries_query','avia_masonry_entries_query_mod', 10, 2);
    function avia_masonry_entries_query_mod($query, $params)
    {
        if(is_singular('post')) {
            $query['post__not_in'] = array(avia_get_the_ID());
        }
        return $query;
    }

    Best regards,
    Ismael

    #1079892

    Hi Ismael,

    Thank you, but unfortunately it didn’t help (cleared browser’s, CDN’s and W3C plugin’s caches).

    Regards,
    Artem

    #1080227

    Hi,

    Thanks for the update.

    Could you give us a link to the page with the masonry element? We’d like to check it.

    Best regards,
    Ismael

    #1080294

    Hi again Ismael,

    Mike helped me in another thread to fix the issue (I incorrectly insterted the code in Quick CSS instead of Functions.php).

    So now it works fine. Thank you very much for your help!

    Best regards,
    Artem

    • This reply was modified 5 years, 8 months ago by artemtik. Reason: Now it's resolved
    #1080489

    Hi Artem,

    Glad you got it working for you! :)

    If you need further assistance please let us know.

    Best regards,
    Victoria

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