• Hiya,

    The header on my blog https://www.jackwallington.com seems to be jumping and is positioned down the page on mobile. It’s only recently started doing this and I don’t remember changing anything that could have caused it. Any advice or help would be much appreciated.

    Thanks,

    Jack

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi Jack!

    I can see that you have a margin-top in the html that is set to important and 46px on small screens.

    The same goes for all screens there the html is set to a margin-top of 32px. See below

    @media screen and (max-width: 782px)
    html {
    margin-top: 46px !important;
    }
    html {
    margin-top: 32px !important;
    }

    Go to your style.css and change the above to margin-top:0;
    and you should be fine.

    Cheers Magnus

    Thread Starter deadtomorrow

    (@jackjjw)

    Thanks Magnus. That makes sense. The only problem is that I can’t find that bit of code… it doesn’t seem to be in the style file or others I’ve looked in :-/

    Hi Jack!
    I now remember that the margin-top is made by wordpress itself for the admin-bar when you are logged in by default.
    You can try to put this code in the functions.php file :

    add_action(‘get_header’, ‘my_filter_head’);
    function my_filter_head() {
    remove_action(‘wp_head’, ‘_admin_bar_bump_cb’);
    }

    If you dont have a child theme installed and put the code in the parents theme it will be removed when you update your theme so the best thing is to install a child theme and put the code in the child’s function.php. Otherwise you must remember to put the code back if you update the Codium Now theme.

    Hope this make sense

    Thread Starter deadtomorrow

    (@jackjjw)

    Hi Magnus,
    Sorry for such a long delay in coming back to you! I finally tried what you suggested, but this makes the header appear beneath the login / admin bar.
    The problem I have is that as soon as someone starts scrolling, the page jumps up rather than seamlessly scrolls with the scrolling header :-/
    Jack

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Fixed header jumping / broken?’ is closed to new replies.