• Resolved apremierdj

    (@apremierdj)


    Hi, I am trying to make Simple Banner fixed. I’ve used the custom CSS position: fixed; – and works but then covers my header. How can I fix this so my header/ nav bar appears correctly and also will not alter the pages where Simple Banner is disabled?

    The page I need help with: [log in to see the link]

Viewing 13 replies - 1 through 13 (of 13 total)
  • Thread Starter apremierdj

    (@apremierdj)

    I’ve removed the position: fixed; for now so my site it operational in the meantime

    Plugin Author rpetersen29

    (@rpetersen29)

    Hi @apremierdj
    Thanks for pointing this out, that’s a bug I’ll put in a fix for tonight. Thanks.

    Thread Starter apremierdj

    (@apremierdj)

    Thanks, I just tested with your update and the header/ nav bar is still being hidden. i’ve put values in the top margin and padding but does not make any changes after clearing cache etc.

    abelldjcompany.com

    Thread Starter apremierdj

    (@apremierdj)

    I’ve changed to “static” for now so my site it operational in the meantime

    Plugin Author rpetersen29

    (@rpetersen29)

    Hi @apremierdj
    First, for the header margin and padding values you can’t just put a number, you need to put a unit afterwards, usually thats px, so it would be 150px. Secondly, looks like you probably want the banner fixed in desktop mode, so keep it as static in the positioning field up top, and in Website Custom CSS:

    @media only screen and (min-width: 990px) {
    .simple-banner {
        position: fixed;
    }
    header {
        margin-top: 40px;
    }
    }
    
    • This reply was modified 6 years, 1 month ago by rpetersen29.
    Thread Starter apremierdj

    (@apremierdj)

    Appears to look great on desktop. thanks for clarifying.

    The header is still covered on mobile. any advice?

    Thread Starter apremierdj

    (@apremierdj)

    Figured it out. Thank you!

    Thread Starter apremierdj

    (@apremierdj)

    Is there a way to disable on “Posts”?

    Plugin Author rpetersen29

    (@rpetersen29)

    Hi @apremierdj
    The recent update, 2.4.2, should fix the disabled pages issue you were seeing. Thanks for bringing this up!

    Thread Starter apremierdj

    (@apremierdj)

    I’m referring to “Posts” not “Pages”

    I’d like to disable the banner on “posts”

    Plugin Author rpetersen29

    (@rpetersen29)

    Hey @apremierdj
    That’s a feature that is currently in development but for now there is a workaround as written in my FAQ: https://ww.wp.xz.cn/plugins/simple-banner/#how%20do%20i%20disable%20the%20banner%20in%20my%20posts%3F

    Thread Starter apremierdj

    (@apremierdj)

    Yes, I seen this and added but does not appear to work on my site. Are you able to see why?

    https://www.abelldjcompany.com/creative-wedding-favor-ideas/

    Plugin Author rpetersen29

    (@rpetersen29)

    The javascript looks for something common in your posts url:

    document.addEventListener('DOMContentLoaded', function(){
      if (window.location.pathname.includes("post")){
        document.getElementById('simple-banner').remove();
      }
    }, false);
    

    window.location.pathname.includes("post") looks for post in your URL. If you’re looking to remove from a specific page then use this:

    document.addEventListener('DOMContentLoaded', function(){
      if (window.location.href === "YOUR_WEBSITE_URL_HERE"){
        document.getElementById('simple-banner').remove();
      }
    }, false);
    

    If you want a few specific urls then:

    document.addEventListener('DOMContentLoaded', function(){
      var urls = ["URL1", "URL2", "URL3"];
      if (urls.includes(window.location.href)){
        document.getElementById('simple-banner').remove();
      }
    }, false);
    
Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘Header Margin’ is closed to new replies.