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

    Hey,

    I have embedded the Magazine Element into a sidebar on a portfolio item page with the intention of displaying other portfolio items that are in the same category. I have selected the do not show duplicates on entire page option however those displayed include the actual portfolio item of the page the user is viewing. Kind of seems pointless to offer an option to view similar portfolios that includes the one of the page we are already on, how would I go about not showing the current item in the list?

    Thanks,
    James.

    #883760

    Hey jamesbarrell,

    Thank you for using Enfold.

    Please use this filter in the functions.php file to exclude the current post in the magazine uery.

    add_filter('avf_magazine_entries_query','avf_magazine_entries_query_mod', 10, 2);
    function avf_magazine_entries_query_mod($query, $params)
    {
        if(is_singular('portfolio')) {
            $query['post__not_in'] = array(avia_get_the_ID());
        }
        return $query;
    }

    Best regards,
    Ismael

    #884175

    Great thanks

    #884312

    Hi,

    Glad we could help. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

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