
-
AuthorPosts
-
April 3, 2025 at 5:31 pm #1480724
Hi,
I’d like to add a notification bar at the very top of the website pages at townleypoolandspa.com. Can you please help me do this simply? Thanks!
JustineApril 4, 2025 at 6:02 am #1480750Hey jnightingale,
Thank you for the inquiry.
You can directly override the header.php file in your child theme or insert widgets into the header area. Another option is to enable the settings in Enfold > Header > Extra Elements > Header Phone Number/Extra Info. Please refer to the documentation for more info.
— https://kriesi.at/documentation/enfold/header/#adding-a-header-widget-area
Best regards,
IsmaelApril 5, 2025 at 2:21 am #1480801Hi, Ismael,
I already have something in the extra elements (the large phone number). I tried using the documentation to add the code to the function.php file, but it wouldn’t save. All I want is a thin colored bar at the top of townleypoolandspa.com that says “FREE delivery within 60 miles”. Is there another way to accomplish this?
Thanks,
JustineApril 5, 2025 at 1:07 pm #1480816Hi,
Try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:function custom_message_banner_script() { ?> <script> (function($){ $('#top #header_meta > .container').each(function() { var messageTitle = 'FREE delivery within 60 miles'; var messageBanner = $('<p class="message-banner">'+ messageTitle +'</p>').css({'text-align':'center','margin-top':'0','background-color':'red','margin':'0','z-index':'1','position':'relative','color':'#fff'}); $(messageBanner).insertBefore('#header_meta'); }); })(jQuery); </script> <?php } add_action( 'wp_footer', 'custom_message_banner_script', 99 );
adjust the colors to suit. This is the result for transparent desktop headers:
and scrolled desktop headers:
and mobile headers:
Best regards,
MikeApril 5, 2025 at 9:18 pm #1480839Thanks, Mike. Do I need to install the child theme first? I don’t have it on the site.
April 5, 2025 at 9:39 pm #1480842Hi,
If you are not using a child theme you could use the WP Code plugin then add a new snippet, in the top right corner use the PHP snippet as the code type:
and ensure that it is activated, then add the above code and save.Best regards,
MikeApril 6, 2025 at 12:42 am #1480855Hey, Mike,
Thanks! i can see the notification bar when I am logged into the backend, but i can’t see it in any other browser when i am not logged in. Thoughts?
Thanks so much!
JustineApril 6, 2025 at 1:20 pm #1480870Hi,
When I check your site while not logged in I see your notification bar:
please clear your browser cache and check.
Please note that testing with iPads & iPhones can be hard to clear the cache, often you need to also clear the history to fully purge the cache, following these steps for Safari and note Step 4 where you will Clear the History.Best regards,
Mike -
AuthorPosts
- You must be logged in to reply to this topic.