Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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!
    Justine

    #1480750

    Hey 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,
    Ismael

    #1480801

    Hi, 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,
    Justine

    #1480816

    Hi,
    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:
    Screen Shot 2025 04 05 at 7.03.19 AM
    and scrolled desktop headers:
    Screen Shot 2025 04 05 at 7.05.19 AM
    and mobile headers:
    Screen Shot 2025 04 05 at 7.06.48 AM

    Best regards,
    Mike

    #1480839

    Thanks, Mike. Do I need to install the child theme first? I don’t have it on the site.

    #1480842

    Hi,
    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:
    use wpcode php snippet and activate
    and ensure that it is activated, then add the above code and save.

    Best regards,
    Mike

    #1480855

    Hey, 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!
    Justine

    #1480870

    Hi,
    When I check your site while not logged in I see your notification bar:
    Screen Shot 2025 04 06 at 7.18.33 AM
    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

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.