Is it possible to have the side widget only on the homepage?

Hi there,

How can I make it so that my side widget bar is only available on the homepage?

Hey @stevenkwlee,

You can hide the sidebar except the home page by adding this code in Appearance > Theme Options > CSS

body:not(.home) .x-sidebar {
    display: none;
}

Hope that helps.

Hey Christian, thank you for this code, it worked.

However, when I use it, there is now a large, empty gap on the right side of my pages, as shown by this picture:

Is there a CSS line that would get rid of this empty space, only on pages other than my homepage (as this is the only page where my side bar would be)?

Thanks!

Hi There,

To remove the empty gap on the right side please add this in the Global CSS. You can do this by going to [ X > Launch > Options > CSS ]

body:not(.home) .x-sidebar {
    display: none;
}

body:not(.home) .x-main.left{
    width:100%;
    float:none;
}

Hope it helps.

Hi, thanks for your response.

However, this still happens:

How might I be able to fix this?

Thanks!

Hi,

You can try this code instead.

body:not(.home) .x-sidebar {
    display: none;
}

body:not(.home) .x-main.left{
    width:100%;
    float:none;
}

body:not(.home) .x-content-sidebar-active .x-container.main:before {
   display:none;
}

body:not(.home) .x-main {
    background: #fff;
}

Hope that helps.

Hey there, thanks for the response. It looks better, but now I’m getting this:

In addition to the codes given above, please add this.

.x-content-sidebar-active .x-container.main:before {
    right: -35%;
}

Hope that helps.

Thank you so much for the help. Now just one last thing:

When I click on a post, there is a big white space to the right:

Is there a way to center the blog posts and featured images to be in the middle?

If you can, please provide instructions on these two separate ideas:

  1. Just centering the featured image

  2. Centering featured image + blog text

Once again, thank you.

Hi There,

1.) To center featured image, use this CSS:

.single-post .entry-thumb {
    text-align: center;
}

2.) Center both featured image and blog text:

.single-post .entry-thumb, .single-post .entry-wrap {
    text-align: center;
}

Hope this helps.

Thank you!!

Glad that we could be of a help :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.