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
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
Hi Basilis,
Got it, thank you for reply! ;)
Regards,
Artem
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
Hi Ismael,
Thank you, but unfortunately it didn’t help (cleared browser’s, CDN’s and W3C plugin’s caches).
Regards,
Artem
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
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
Hi Artem,
Glad you got it working for you! :)
If you need further assistance please let us know.
Best regards,
Victoria