• Resolved jokkie

    (@jokkie)


    Hi there,

    I have a website with a landing/intro page, where I don’t want to show the cookie banner. I followed the steps in this article but the banner is still showing on the first page.

    How can I fix this?

    Thank you!
    Kind regards,
    Jonas

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

Viewing 2 replies - 16 through 17 (of 17 total)
  • Plugin Contributor Aert Hulsebos

    (@aahulsebos)

    Hi @jokkie,

    It includes the homepage; the ‘shop’ is for paths without redirect.

    
    <?php
    
       function cmplz_my_filter_site_needs_cookiewarning( $cookiewarning_required ) {
        $url = is_ssl() ? "https" : "http";
        $url .= "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
    
        // Don't show cookie banner on pages where the URL contains "shop"
        // or on the homepage without any path
        if ( strpos( $url, 'shop' ) !== false || $url === home_url( '/' ) ) {
            $cookiewarning_required = false;
    
            // To disable the cookie blocker, uncomment the following
            // define('CMPLZ_DO_NOT_BLOCK', true);
        }
    
        return $cookiewarning_required;
    }
    
    add_filter( 'cmplz_site_needs_cookiewarning', 'cmplz_my_filter_site_needs_cookiewarning' );
    Thread Starter jokkie

    (@jokkie)

    Hi Aert,

    Thank you, that did the trick!!

    Kind regards,
    Jonas

Viewing 2 replies - 16 through 17 (of 17 total)
  • The topic ‘hiding the banner does not work’ is closed to new replies.