Change background colour of sidebar

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #6552 Reply
    Adam
    Guest

    Thanks for the theme – is it possible to change the background colour of the sidebar(s) and make it continue to the bottom of the page? At th moment when I add a background colour via custom css- the background colour doesn’t fill the entire sidebar, only up until the last widget.

    Many thanks for any suggestions.

    #6554
    Ron
    Keymaster

    You can add this code to make the content and sidebar the same height.

    #main {
       display: flex;
    }
    #6555
    Adam
    Guest

    Thank you – this did make them the same height – unfortunately both sidebars now appear on the right hand side of the page, is there a way to stop this from happening?

    Thank you.

    #6558
    Ron
    Keymaster

    Remove the CSS code above then add this on a child-theme functions.php

    add_action( 'wp_footer', 'ra_same_height_script' );
    
    function ra_same_height_script() {
    ?>	
    <script>
       jQuery(document).ready(function($) {
          var height = Math.max($("#content").height(), $("#sidebar-left").height(), $("#sidebar-right").height());
          $("#content").height(height);
          $("#sidebar-left").height(height);
          $("#sidebar-right").height(height);
       });
    </script>
    <?php
    }
    #6559
    Adam
    Guest

    Thank you for the quick response. I have just tried the above and can confirm that it has worked. Thank you.

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: Change background colour of sidebar
Your information: