Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1189356

    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

    #1189973

    Hi Alice,

    Can you give us atleast a link of the page that has the issue? so we can inspect further.

    Best regards,
    Nikko

    #1190257

    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

    #1190767

    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

    #1191660

    Hi Nikko,

    Thank you that works perfectly!

    Thanks
    Alice

    #1191801

    Hi Alice,

    We’re glad that we could help :)
    Thanks for using Enfold and have a great day!

    Best regards,
    Nikko

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘exclude the current post item from the masonry element’ is closed to new replies.