• Resolved Stephanie79nl

    (@stephanie79nl)


    Hello guys,

    Love your plugin! Quick question, I would like to hide the Mailchimp top bar on one page only. In your FAQ examples you only show the codes of where the top bar SHOULD show. Is there a code to NOT SHOW it on one page only?

    And where do I place that code? Do I edit the code of the plugin when I go to plugins and click on “edit”. Just to make sure I’m adding the code in the right place.

    I look forward to your reply. Thanks in advance!

    Best,

    Stephanie

    https://www.ads-software.com/plugins/mailchimp-top-bar/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Lap

    (@lapzor)

    You can use the code from the FAQ example with a simple “is not” instead of is, this is done by placing an exclamation mark in front of it as so:

    add_filter( ‘mctb_show_bar’, function( $show ) {
    return !is_page(‘contact’);
    } );

    Now the bar is shown except if the page is “contact”.

    Thread Starter Stephanie79nl

    (@stephanie79nl)

    Dear Lap,

    Thank you for the code. I’m about to use it but where exactly do I place it?

    Please let me know.

    Best,

    Stephanie

    Thread Starter Stephanie79nl

    (@stephanie79nl)

    I see so many files. What file will work? mailchimp-top-bar.php? Is that the correct one?

    Thread Starter Stephanie79nl

    (@stephanie79nl)

    I guess that was the one because it worked! (I’m glad I didn’t break my site lol)

    Plugin Contributor Lap

    (@lapzor)

    Hi,

    Actually this code should be added to functions.php.

    Please see: https://mc4wp.com/kb/adding-code-to-to-your-website/

    If you put it in a plugin file as you did now, it will be overwritten with the next update of that plugin.

    Thread Starter Stephanie79nl

    (@stephanie79nl)

    Hello Lap,

    Thank you I changed it in functions.php but I just found out that with the code you gave me, the top bar still shows up on mobile devices. Can I prevent this? What should I do?

    Best,

    Stephanie

    Thread Starter Stephanie79nl

    (@stephanie79nl)

    Hello Lap, did you see my follow up message? The top bar still shows up on mobile devices. Is there a way it can be excluded on mobile devices on certain pages too (not just on desktop)?

    Please let me know, thanks!

    Best,

    Stephanie

    Thread Starter Stephanie79nl

    (@stephanie79nl)

    Actually I don’t think this code works anymore at all. It’s still showing on desktops too. If you have a fix for this, I would love to know, thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Hide Mailchimp top bar on only one page’ is closed to new replies.