Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • #1467317

    I’m trying to add space between the bottom of the content area and the footer widget area, but not having much luck.

    I am redeveloping an existing website using Enfold. The existing website was developed using an older theme.

    Any help with this would be appreciated. Thanks!

    #1467408

    Hey NicomIT,

    Thank you for the inquiry.

    You can use this css code to adjust the top margin of the #footer container, creating more space between it and the main content wrapper.

    #footer {
        margin-top: 1000px;
    }

    Best regards,
    Ismael

    #1467464

    Thanks Ismael.
    That added space to that area, but the area where the margin is has a white background. Can you let me know how to increase that margin and not have a background color? We only need to have the white background color in the main content area and in the widget/footer area. The area where the margin is being added, should have no background color so you can see the main background image used by the website.

    #1467492

    Hi,

    Thank you for the update.

    You may need to set the background color of the main container to transparent to replicate the design of the other site. Please try replacing the modification with this css code:

    body, #wrap_all, #main {
        background: transparent !important;
    }
    
    #footer {
        margin-top: 500px;
        background-color: white;
    }

    Best regards,
    Ismael

    #1467538

    Thanks Ismael. Unfortunately, that didn’t work. Is there anything else we can try?

    #1467614

    Hi,
    Thank you for the link to your site, currently I see screenshot 1 below.
    When I add Ismael’s css I see screenshot 2 below.

    body, #wrap_all, #main {
        background: transparent !important;
    }
    
    #footer {
        margin-top: 50px;
        background-color: white;
    }

    This looks like your example site, screenshot 3 below.
    If the screenshot looks correct but you are not seeing this, try clearing your browser cache following these steps for Safari and note step 4 where you will Clear the History.

    Best regards,
    Mike

    #1467666

    Thanks Mike. I found the issue. It looks like there was some additional code in my CSS that was still making the background of the area white.

    #main {
        background-color: white !important; /* Keep the white background only in the main content area */
    }

    Things look good now, except that the area where the margin was added to the bottom of the page is still displaying as white on the home page. Is there something different that needs to be done for that page? All the other pages in the website are displaying things fine.

    #1467686

    Hi,
    For the homepage try this css:

    #top.home #main #av_section_1 {
    	  margin-bottom: 50px;
    }

    Best regards,
    Mike

    #1468934

    I have been working on this a bit more and added a background image to display at the top of the header area on the pages in the website. You can see what I am referring to in the area in this screenshot that has the red outline around it:
    https://hfxfarmersmarket.nicomitcms.com/wp-content/uploads/2024/10/Background-Example.jpg
    I am trying to add the same type of background to the bottom of the main content container and the top of the footer container, but not having much luck. See the red outlined areas in this screenshot:
    https://hfxfarmersmarket.nicomitcms.com/wp-content/uploads/2024/10/Content-and-Footer-Example.jpg
    If someone could let me know how I could do this, it would be great. The link to the website is included in the private data below. Thanks!

    #1469000

    Hi,
    Try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:

    function custom_script() { ?>
      <script>
    document.addEventListener("DOMContentLoaded", function() {
        var footer = document.getElementById('footer');
        var afterSlideshow = document.getElementsByClassName('el_after_av_slideshow');
        if (footer) {
            var newDivFooter = document.createElement('div');
            newDivFooter.className = 'custom-header-background-footer';
            footer.appendChild(newDivFooter);
        }
        if (afterSlideshow.length > 0) {
            var newDivSlideshow = document.createElement('div');
            newDivSlideshow.className = 'custom-header-background-bottom';
            afterSlideshow[0].appendChild(newDivSlideshow); 
        }
    });
    </script>
      <?php
    }
    add_action( 'wp_footer', 'custom_script', 99 );

    Then add this CSS in your Enfold Theme Options ▸ General Styling ▸ Quick CSS field:

    .custom-header-background-footer {
        background-image: url(/wp-content/uploads/2024/09/top_no_fade.png);
        background-repeat: repeat-x;
        background-position: bottom center;
        background-size: auto;
        height: 50px;
        width: 100%;
        position: absolute;
        top: -50px;
    }
    .custom-header-background-bottom {
        background-image: url(/wp-content/uploads/2024/09/top_no_fade.png);
        background-repeat: repeat-x;
        background-position: bottom center;
        background-size: auto;
        height: 50px;
        width: 109%;
        position: absolute;
        top: 25px;
        left: -5%;
        transform: rotate(180deg);
    }

    Please ensure to copy the code from the forum and not an email notification so the symbols are not converted.

    Best regards,
    Mike

    #1469156

    Thanks Mike. That worked great.

    Is there a way to display the background at the bottom of the main content container on all the pages in the website? After making these updates, it’s displaying there on the home page, but not the other pages/posts. The background that displays at the top of the footer is showing on all the pages/posts, so that is great.

    One small thing I noticed is the background at the bottom of the main content container doesn’t extend quite to the full width of the area above it. When you view the home page on a large screen/full width, it looks like there’s approximately 4 pixels on the right of it where the background doesn’t go all the way to the edge of the content container. If you resize your browser to make the screen smaller, it looks like the same thing happens on the left and right sides, but it’s more noticeable. I placed a red border around the background to make this a little easier to see.

    If you could let me know what would need to be adjusted so the background extends the fill with of the content area, that would be appreciated. The way the background displays above the footer area is prefect and is what I would like this to look like.

    Thanks again for the help.

    #1469346

    Hi,
    Thanks for your patience, for the bottom of the content on your other pages try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:

    function custom_script_bottom() { ?>
      <script>
    document.addEventListener("DOMContentLoaded", function() {
        var contentDiv = document.querySelector('.template-page.content');
        
        if (contentDiv) {
            var newDivContent = document.createElement('div');
            newDivContent.className = 'custom-header-background-content';
            contentDiv.appendChild(newDivContent);
        }
    });
    </script>
      <?php
    }
    add_action( 'wp_footer', 'custom_script_bottom', 99 );

    and this css:

    .custom-header-background-content {
        background-image: url(/wp-content/uploads/2024/09/top_no_fade.png);
        background-repeat: repeat-x;
        background-position: bottom center;
        background-size: auto;
        height: 50px;
        width: 109%;
        position: absolute;
        bottom: -50px;
        left: -5%;
        transform: rotate(180deg);
    }

    Best regards,
    Mike

    #1469392

    Thanks Mike. That worked perfectly.

    Do you happen to know how I can adjust the background at the bottom of the main content container so it is the full width of the content container? I still have a red border on that on the home page so you can see where the background doesn’t quite go all the way to the right edge of the container. If you resize the screen and make it smaller, you will see the gap increases and also appears on the left. If you could let me know what to adjust so that fills the full width of the container, that would be awesome.

    It looks like this is happening on all the pages for the background at the bottom of the main content container. But the background at the top of the header and footer areas all look fine. So I just need this one to display the same as those.

    Thanks again for the help.

    #1469399

    Hi,
    To adjust the main content container so it is the full width of the content container try changing the width from 100% to 110%, I don’t see a red line:
    Enfold Support 6511

    Best regards,
    Mike

    #1469412

    Thanks Mike. It was set to 109%. Changing it to 110% looks like it worked when viewed full screen. But when the browser window is resized or the website is viewed on smaller devices, the background starts to not expand all the way along the bottom of the content container (on the left and right).

    Here’s the CSS I currently am using for that:

    .custom-header-background-bottom {
        background-image: url(/wp-content/uploads/2024/09/top_no_fade.png);
        background-repeat: repeat-x;
        background-position: bottom center;
        background-size: auto;
        height: 50px;
        width: 110%;
        position: absolute;
        top: 25px;
        left: -5%;
        transform: rotate(180deg);
        border: #FF0004 solid thin !important;
    }
    • This reply was modified 1 month ago by NicomIT.
    #1469454

    Hi,
    To adjust this for other screen sizes you can copy the css and wrap in a media query, for example for mobile device add this

    @media only screen and (max-width: 767px) { 
    .custom-header-background-bottom {
        background-image: url(/wp-content/uploads/2024/09/top_no_fade.png);
        background-repeat: repeat-x;
        background-position: bottom center;
        background-size: auto;
        height: 50px;
        width: 118%;
        position: absolute;
        top: 25px;
        left: -9%;
        transform: rotate(180deg);
    }
    }

    also leave your other css for desktop, if you find another size that needs adjusting then follow the same steps.

    Best regards,
    Mike

    #1469842

    That’s great. Thanks for all of your help Mike.

    #1469855

    Hi,
    Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 18 posts - 1 through 18 (of 18 total)
  • The topic ‘Add Margin Between Bottom of Content Area on Pages and Footer Widget ASrea’ is closed to new replies.