Hello,
Can you please give me the code that will exclude the current post item from the masonry element. I did this with the portfolio grid element with this code…
add_filter(‘avia_post_grid_query’,’avf_post_grid_query_mod’, 10, 2);
function avf_post_grid_query_mod($query, $params)
{
if(is_singular(‘portfolio’)) {
$query[‘post__not_in’] = array(avia_get_the_ID());
}
return $query;
}
Thanks
Alice
Hi Alice,
Can you give us atleast a link of the page that has the issue? so we can inspect further.
Best regards,
Nikko
Hi Nikko,
Sure, an example page is: https://adxarchitectural.com.au/pembroke-project/ where the post item is “Pembroke project” and in the Related Products at the bottom of the page the same post is listed.
The site is in maintenance mode so you will have to login to view the page, the credentials are in private content.
Thanks
Alice
Hi Alice,
Thanks for giving us admin access.
After checking it the code works fine but it only works in single portfolio pages as defined in your condition and has verified this to be working on the link in private content.
Can you try to change this part:
if(is_singular('portfolio')) {
to:
if( is_single() ) {
Best regards,
Nikko
Hi Nikko,
Thank you that works perfectly!
Thanks
Alice
Hi Alice,
We’re glad that we could help :)
Thanks for using Enfold and have a great day!
Best regards,
Nikko