Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #228277
    Brent F
    Participant

    Hello,

    I am building a website using Ethos in wordpress and am running into an issue where if there is A)not enough content on a page or B)a user is using a high-resolution/large monitor the footer bar appears to float in the middle of the screen.

    I have tried locking the footer to the bottom of the page by adding the custom css to the footer

    
    position: absolute;
    width: 100%;
    bottom: 0;
    left: 0;
    

    And the sort of works because it does lock the footer to the bottom of the browser window, but when viewed on mobile devices the footer takes up 70% of the window.

    Is there anyway I can have the footer remain on the bottom of the browser window if there is not enough content to fill a page, and stick to the bottom of content if there is?

    Current theme and plug-in versions:
    X-Theme: 3.2.2
    X-Shortcodes: 3.0.4

    See reply for website link. Thanks!

    #228279
    Brent F
    Participant
    This reply has been marked as private.
    #228364
    Zeshan
    Member

    Hi Brent,

    Thanks for writing in!

    Add following code under Custom > JavaScript in the Customizer:

    jQuery(document).ready(function($) {
      var $main = $('.x-main'),
          $windowHeight = $(window).outerHeight(),
          $masthead = $('.masthead').outerHeight(),
          $wpbar = $('#wpadminbar').outerHeight(),
          $footer = $('.x-colophon.bottom').outerHeight() + $('.x-colophon.top').outerHeight();
     
      $main.css('min-height', $windowHeight - $masthead - $wpbar - $footer - 70);
    });
    

    Hope this helps. 🙂

    Thank you.

    #229352
    Brent F
    Participant

    Worked like a charm. Thank you so much!

    #229553
    Nabeel A
    Moderator

    Glad we could help.

    Cheers!

    #301038
    birender1
    Participant

    Hi,

    I am experiencing the same problem with my ethos theme but unfortunately this solution doesn’t work for me.
    Are you able to help me with this issue please?

    Birender

    #301046
    birender1
    Participant

    When I paste the css and java script codes in custom textbox, the footer bar takes up the entire screen space.

    #301317
    Thai
    Moderator

    Hi @Birender1,

    Thanks for writing in! To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.

    #301823
    birender1
    Participant
    This reply has been marked as private.
    #302001
    Rue Nel
    Moderator

    Hello There,

    I have added your site in my host file but still can not view your X powered site. Is there any possibility that you can make it live? It would be much easier for us.

    Thanks for understanding.

    #302077
    birender1
    Participant

    The website was offline for a while. Can you please try again?
    Also please make sure your hosts.ini file entry is setup without http and must start with www

    Apologies for the inconvenience.

    #302231
    Paul R
    Moderator

    Hi,

    You don’t need to add the css code, you only need to the js code under Custom > Javascript in the Customizer.

    
    jQuery(document).ready(function($) {
      var $main = $('.x-main'),
          $windowHeight = $(window).outerHeight(),
          $masthead = $('.masthead').outerHeight(),
          $wpbar = $('#wpadminbar').outerHeight(),
          $footer = $('.x-colophon.bottom').outerHeight() + $('.x-colophon.top').outerHeight();
     
      $main.css('min-height', $windowHeight - $masthead - $wpbar - $footer - 70);
    });
    

    Thanks

    #302935
    birender1
    Participant
    This reply has been marked as private.
    #303247
    Paul R
    Moderator

    Hi,

    Upon checking, I can see the the code was not working because there is a syntax error in your custom javascript code

    Please remove the code that reads

    
    <!--[if lte IE 8]>
    document.write('<div style="background:red;">IE8 is not supported. You're using an UNSUPPORTED version of Internet Explorer. Please update to latest version or install Chrome, Firefox, Torch, Safari browsers.</div>');
    <![endif]-->
    
    <!--[if lte IE 7]>
    alert("IE7 is not supported. You're using an UNSUPPORTED version of Internet Explorer. Please update to latest version or install Chrome, Firefox, Torch, Safari browsers.");
    <![endif]-->
    
    <!--[if lte IE 6]>
    alert("IE6 is not supported. You're using an UNSUPPORTED version of Internet Explorer. Please update to latest version or install Chrome, Firefox, Torch, Safari browsers.");
    <![endif]-->
    

    Conditional comments like <!–[if lte IE 8]> will only work in css and not in js.

    Thanks

    #304166
    birender1
    Participant

    That worked…thanks a lot for your help. You guys rock 🙂

  • <script> jQuery(function($){ $("#no-reply-228277 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>