• Resolved cmshea058

    (@cmshea058)


    Hi there. Am wondering if there is some custom code I can add that will retain the shop announcement but remove the option to dismiss it. My client would like the shop announcement to be permanent.

    As usual, any help would be greatly appreciated!

    Thank you

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi.

    All you need to do is add a filter to remove that message. In your active theme’s ‘functions.php’ file you need to add the following code. First, that file is located here: “/wp-content/themes/{yourActiveThemeName}/functions.php”.

    At the very bottom (or wherever you’d like) paste the following code:

    // ----------------- Remove "Dismiss" message from Store Banner -----------------------------------------------------------------
    add_filter('woocommerce_demo_store', 'removeDismissMessageFromStoreBanner', 2, 99);
    
    function removeDismissMessageFromStoreBanner($notice_with_dismiss_message, $notice_without_dismiss_message)
    {
    	echo '<p class="woocommerce-store-notice demo_store">' . wp_kses_post( $notice_without_dismiss_message ) . '</p>';
    }
    // ------------------------------------------------------------------------------------------------------------------------------
    Thread Starter cmshea058

    (@cmshea058)

    Once again I have come to this forum with a problem and some extremely helpful soul has helped me. Am so grateful. Thank you precisionpac!!

    You’re welcome!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to Remove Dismiss Option From Announcement’ is closed to new replies.