• Resolved hedro3

    (@hedro3)


    Good day folks.

    I’m trying to remove the side bar only from my site’s home page. Side bars should still exist on all other pages. I’m using the Sports Blog theme plugin. My site home page has been set to the latest posts.

    I don’t see an option where I can change the page/column width to 100% or disable the side bar.

    I’d appreciate any help here.

    Cheers!

    Hector

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • I don’t see an option where I can change the page/column width to 100% or disable the side bar.

    Your theme doesn’t have any of these features.

    So we’ll have to use custom CSS in APPEARANCE => CUSTOMIZE => ADDITIONAL CSS

    Try the following custom CSS:

    .home aside#secondary {
        display: none;
    }
    
    .home div#primary {
        width: 100%;
    }

    Standing by for feedback.

    Thread Starter hedro3

    (@hedro3)

    George,

    I’m not in front of my PC now, but that CSS looks similar to what I tried earlier. It removed the side bar from ALL pages and posts. Note that I only want to remove the side bar from my home page.

    Again, I’m not in front of my PC and will have to confirm tomorrow if it’s the same CSS I tried.

    I appreciate your help.

    Cheers,

    Hector

    … but that CSS looks similar to what I tried earlier. It removed the side bar from ALL pages and posts.

    Similar, but perhaps not the same ??

    Note the .home in front of both selectors. This restricts the scope to ONLY pages with this class, which should be just the homepage.

    Thread Starter hedro3

    (@hedro3)

    George,

    Your code is PERFECT! And you’re right, it’s similar to what I tried but not the same code. MANY THANKS!

    This code (among others, including plug ins) is what I tried earlier with no success:

    #secondary
    {
    	display:none;
    }
    
    #primary
    {
    	width: 100%;
    }
    

    Can you point me to where I can learn about the basics of CSS coding?

    Cheers man! I really appreciate what you’ve done for me.

    Hector

    Can you point me to where I can learn about the basics of CSS coding?

    CSS is inherently intertwined with HTML, so unless you’re very good with modern HTML5, you’ll be better off learning the two together.

    FreeCodeCamp.org’s Responsive Web Design course covers both bases. It’s interactive, project-based, and completely free: https://www.freecodecamp.org/learn/2022/responsive-web-design/

    If you’re only looking for a CSS reference, Mozilla Developer Networks (MDN) is the gold standard (other than the technical standard itself, which is not beginner-friendly): https://developer.mozilla.org/en-US/docs/Web/CSS

    Good luck!

    Thread Starter hedro3

    (@hedro3)

    George,

    Once again, many thanks! Much appreciated!

    Hector

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Remove side bar only from home page’ is closed to new replies.