• Resolved ivohuber

    (@ivohuber)


    Dear Anders,

    what an amazing new Theme poe is. I have only one question: How do I get a sticky header like in Chaplin. That was very responsive that time.

    Yours
    Ivo

Viewing 14 replies - 1 through 14 (of 14 total)
  • Theme Author Anders Norén

    (@anlino)

    Hi @ivohuber,

    Glad you like it! The Site Editor doesn’t have any built-in options for sticky elements. It’s possible to make it sticky with custom CSS, but the exact CSS will depend a little bit on how your header is structured. I can post the CSS for your current setup if you post a link to your site.

    — Anders

    Thread Starter ivohuber

    (@ivohuber)

    Dear Anders,

    that would be wonderful!

    Actually my website is running with Chaplin and I would like to change to a full site editing theme with more possibilities. As far as I see Poe brings me to what I want.

    You will find my website here: https://www.ivohuber.de

    If I may ad a further wish? I have never worked with CSS therefore I would appreciate it if you could give an advice where I get the necessary information to ad the CSS you kindly will provide.

    Ivo

    Theme Author Anders Norén

    (@anlino)

    Hi @ivohuber,

    The following CSS should work with the default structure of the Poe header (the one used on the demo site). It might break if the header is changed, so that’s something to keep an eye out for when you adjust the header in the Site Editor.

    .wp-site-blocks {
    	padding-top: calc( ( var( --wp--custom--spacing--outer ) * 2 ) + 1em );
    }
    
    .site-header {
        background-color: var( --wp--preset--color--background );
        position: fixed;
            top: 0;
        width: 100% !important;
        z-index: 999;
    }

    Any custom CSS plugin will do, like this one: https://www.ads-software.com/plugins/simple-custom-css/

    — Anders

    Thread Starter ivohuber

    (@ivohuber)

    Dear Anders,

    thank′s a lot. Simple CSS works fine. What a wonderfull, easy to handel tool!

    But I do get the message that the CSS provided wan′t work. When I tip: background-color:var (–wp–preset–color–background); is says: ! Exspected (<color>) but found var (--wp--preset--color--background). Also the result on my Testpage is funny: https://www.test.ivohuber.de as you can see.

    What do I make a wrong?

    Ivo

    Theme Author Anders Norén

    (@anlino)

    Hi @ivohuber,

    It’s possible that the plugin I linked to doesn’t support CSS variables, so you might have better results trying a different custom CSS plugin.

    — Anders

    Thread Starter ivohuber

    (@ivohuber)

    Hi Anders,

    I got the CSS now in with the plugin “WPCode – Insert Headers, Footers, and Code Snippets” but the result is not as I want it: https://www.testivohuber.de as the header apears double now.

    Sorry to make so much hassle! Just to informe you: I deleted de page completedly to start afresh as I wasn′t shure wether the CSS I inserted with the previous plugin would be still aktive.

    What can I do?

    Ivo

    Theme Author Anders Norén

    (@anlino)

    Hi @ivohuber,

    It’s not the header that appears twice, but the footer that is visible below the header. Try changing the CSS I posted to the following:

    .wp-site-blocks {
    	padding-top: 6em;
    }
    
    :root .site-header {
        background-color: var( --wp--preset--color--background );
        position: fixed;
            top: 0;
        width: 100% !important;
        z-index: 999;
    }

    — Anders

    Thread Starter ivohuber

    (@ivohuber)

    You are abselutely right! Header and Footer o.k. now. Unfortunetely the header won′t be sticky. What do I miss out?

    Ivo

    Theme Author Anders Norén

    (@anlino)

    @ivohuber It looks like you’ve removed the custom CSS – I can’t see it being loaded on the front-end anymore.

    Thread Starter ivohuber

    (@ivohuber)

    I double checked everything. The CSS added at the moment is:

    .wp-site-blocks {
    	padding-top: 6em;
    }
    
    :root .site-header {
        background-color: var( --wp--preset--color--background );
        position: fixed;
            top: 0;
        width: 100% !important;
        z-index: 999;
    }

    only.

    Did I forget anything?

    Ivo

    Theme Author Anders Norén

    (@anlino)

    @ivohuber The CSS you’ve posted here is correct, but there are some misspellings in the CSS that you’ve added on your site. This is what is output in the HTML:

    .wp-site-blocks{
    	padding-top:6em;
    }
    
    :root.side.header {
    	background-color:vor(--wp--preset--color--background);
    	position: fixed;
    	top:0;
    	width:100% !important;
    	z-index:999;
    
    }

    Note the :root.side.header part, which should be :root .site-header.

    Edit: Oh, and vor(--wp--preset--color--background); should be var(--wp--preset--color--background);.

    • This reply was modified 2 years, 2 months ago by Anders Norén.
    Thread Starter ivohuber

    (@ivohuber)

    Sorry, again, but it doesn′t work. Here again the current CSS:
    .wp-site-blocks {
    padding-top: 6em;
    }

    :root.side-header {
    background-color: var(–wp–preset–color–background);
    position: fixed;
    top: 0;
    width: 100% !important;
    z-index:999;
    }

    I am at the end of any idea. The header will not be fixed ….

    Theme Author Anders Norén

    (@anlino)

    @ivohuber You need to change :root.side-header to :root .site-header. If you do, it should work.

    Thread Starter ivohuber

    (@ivohuber)

    Wow that′s it. Thanks a lot for your skills and pation!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Sticky header’ is closed to new replies.