• Resolved savethefrogs

    (@savethefrogs)


    Hi,

    The Shipping & Returns post is appearing in the blog even though it is Search Excluded.
    https://bansuribliss.com/blog

    I added the following code to Fluent Snippets to fix the issue but it doesn’t work.
    What do you suggest?
    Thanks!

    add_action('pre_get_posts', function ($query) { 
        if (!is_admin() && $query->is_main_query() && $query->is_archive()) { 
            $search_exclude_ids = get_option('sep_exclude'); 
            if ($search_exclude_ids) { 
                $posts_not_in = $query->get('post__not_in', array()); 
                $query->set('post__not_in', array_merge($posts_not_in, $search_exclude_ids)); 
            } 
        } 
    });

    The page I need help with: [log in to see the link]

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