• 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 15 replies - 1 through 15 (of 17 total)
  • Plugin Contributor Aert Hulsebos

    (@aahulsebos)

    Hoi @jokkie,

    Did you use the MU plugin, or the native option?

    If you could show me the landing page, that might be helpful.

    In both cases, try to clear cache as well, and/or try incognito.

    regards Aert

    Thread Starter jokkie

    (@jokkie)

    Hi Aert,

    I used the option on the page settings as you can see here, it’s activated.
    The first page is this one.

    I already tried different browsers incognito mode, but unfortunately, the cookie banners keeps popping up at the first page.

    Thanks for the support!
    Kind regards,
    Jonas

    Plugin Contributor Aert Hulsebos

    (@aahulsebos)

    Hi @jokkie,

    It redirects twice for me, from /landing to / to /mystika

    If you want to disable on multiple pages, or post types there are other options. Disabling on your Homepage requires another solution as well, as we’re taking the string after / and using it in a filter.

    Let me know the desired outcome, which page(s). I can help you out,

    regards Aert

    Thread Starter jokkie

    (@jokkie)

    Hi Aert,

    /landing is the homepage, that’s where I want to disable the cookie banner, so it doesn’t block the preloader animation (especially on mobile)

    Thank you!!

    Kind regards,
    Jonas

    Plugin Contributor Leon Wimmenhoeve

    (@leonwimmenhoeve)

    Hi @jokkie,

    If I understand your question correctly, you would like to hide the banner during the animation, which is actually on the root URL, correct? After the animation, there is a redirect to /mystika, for which it seems fine if the cookie banner is displayed.

    Did you try just to disable the cookie banner on the root URL? If it doesn’t work, I recommend to use the MU-plugin, as my colleague and the article suggested: https://complianz.io/excluding-pages-from-the-cookie-banner/

    Kind regards,
    Leon

    Thread Starter jokkie

    (@jokkie)

    Hi Leon,

    I want to disable the banner on the root indeed, the problem is, I think, I just can’t enter the page id/slug (“landing”) in the PHP code, because it’s the root.
    I tried to disable it with the method in the page editor but that does not seem to work unfortunately.

    Thank you!
    Kind regards,
    Jonas

    Plugin Contributor Leon Wimmenhoeve

    (@leonwimmenhoeve)

    Hi @jokkie,

    Please try the mu-plugin solution. I suspect that that will work.

    Kind regards,
    Leon

    Thread Starter jokkie

    (@jokkie)

    Ok could you guide me how to use that please?

    Thank you so much
    Jonas

    Plugin Contributor Leon Wimmenhoeve

    (@leonwimmenhoeve)

    Hi @jokkie,

    We have described that step by step here: https://complianz.io/excluding-pages-from-the-cookie-banner/

    For more background on mu-plugins, also step by step: https://complianz.io/adding-filters-with-mu-plugins-quick-easy/

    Please let us know if you have any questions after going through these guides.

    Regards,
    Leon

    Thread Starter jokkie

    (@jokkie)

    Hi,

    I’ve added a php file in the /wp-content/mu-plugins folder but now I get a WordPress error.

    <?php
    defined( 'ABSPATH' ) or die( "you do not have acces to this page!" );
    
    /**
     * Filter post types for cookiewarning
     * It's too early to use global $post or url_to_postid(), so we do a simple text comparison
     *
     * @param int $cookiewarning_required
     *
     * @return bool
     */
    
    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 page where the URL contains the parameter "shop"
    	if ( strpos( $url, 'landing' ) !== false ) {
    		$cookiewarning_required = false;
    
    		//to disable the cookieblocker, uncomment the following
    		define('CMPLZ_DO_NOT_BLOCK', true);
    	}
    
    	return $cookiewarning_required;
    }
    
    add_filter( 'cmplz_site_needs_cookiewarning', 'cmplz_my_filter_site_needs_cookiewarning' );
    Plugin Contributor Aert Hulsebos

    (@aahulsebos)

    Hi @jokkie,

    You can set the file to .txt to fix it. I tried your MU plugin without issues, so maybe it would be wise to enable debugging and see the error.

    regards Aert

    Plugin Contributor Aert Hulsebos

    (@aahulsebos)

    You can find the example here; https://app.instawp.io/wordpress-auto-login?site=%242y%2410%24wQfD9K.Au2.KHpPMTp5HZenSezt%2F0e7Es6sS54autJ3L0CdRKQvdq

    Under File Manager you see my implementation.

    regards Aert

    Thread Starter jokkie

    (@jokkie)

    Hi Aert,

    I fixed the PHP error. I copied the exact code from your example and put that in the cookiebanner.php at /wpcontent/mu-plugins

    However, when testing incognito, the banner still shows up at the front page.

    Could it really not having to do with the fact that mystika.be/landing gets redirected automatically to the root mystika.be, so the PHP script with ‘landing’ is therefore not applied?

    Thank you so much for the support! I really appreciate this ??

    • This reply was modified 1 year, 4 months ago by jokkie.
    Plugin Contributor Aert Hulsebos

    (@aahulsebos)

    Hi @jokkie, yes, this reverts back to my previous message:

    “It redirects twice for me, from /landing to / to /mystika

    If you want to disable on multiple pages, or post types there are other options. Disabling on your Homepage requires another solution as well, as we’re taking the string after / and using it in a filter.

    Let me know the desired outcome, which page(s). I can help you out”

    If you can let me know what you want to achieve in detail, I can see what we can.

    regards Aert

    Thread Starter jokkie

    (@jokkie)

    Hi Aert,

    Ok well then I need the solution for disabling on my homepage as well, that’ll do the trick I guess ??

    Thank you!
    Jonas

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