Support » Plugin: WP Notification Bars » Fix for bar covering header

  • Resolved amandathewebdev


    Hi all,

    This isn’t a request for help. I wanted to share my fix for the navigation bar covering my header.

    I added this to my header.php file:

    jQuery(document).ready(function($) {
        var height= $(".mtsnb").height();
        $("#header").css({marginTop: height});

    This grabs the height of the notification bar, then adds that value as a margin to the top of my header. It only applies if the notification bar is active.

    If you have other issues with absolute/fixed position elements, some variation of the above would solve it.

Viewing 3 replies - 1 through 3 (of 3 total)
  • This didn’t work for me. Instead I used this:

    .mk-header .mk-header-inner {
    padding-top: 3%;
    padding-bottom: 3%;

    Plugin Author MyThemeShop



    I am glad that you have managed to fix the issue. I will check this on my end if the plugin needs modifications.

    I’m closing the ticket.

    Thank you

    Thanks much for sharing your fix, Amanda — that little jquery script is perfect. We have a sticky header, so for our case, I replaced “#header” for the class of the fixed header container, and this script worked brilliantly. (Kmoloo above could probably have made this work by swapping “#header” for the container in his theme, “.mk-header”).

    Been playing with (and failing at) trying to figure out how to make this work with the “x to close” feature (so if the close button is enabled, and the promo bar is toggled off) to make the header scroll back up to the top. Not important, but curious now how that would be done.

    Thanks again for the original fix — this makes the bar actually usable and should be included in the main plugin script.

    Note to @mythemeshop: it would be great if the button hover color were one of the style settings. I made this happen with a customization in the child theme, but the plugin would be more powerful if this were built-in. Thanks for the good work — this is a good, solid, simple top bar!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Fix for bar covering header’ is closed to new replies.