WordPress.org

Ready to get started?Download WordPress

Forums

Spun
[resolved] Having the sidebar on the right but not in the home page (8 posts)

  1. Ajisai
    Member
    Posted 1 year ago #

    Hi there,

    I'd like to know if it's possible to put the sidebar on the right but only in the articles? I don't want it visible on the homepage.

    I already tried this code in the css, the sidebar is on the right, it's nice but, as I said, I don't want it on the homepage.

    Any help?
    Thx

    #primary {
    	float: left;
    	width: 80%;
    }
    
    #secondary {
    	clear: right;
    	display: block;
    	padding: 10px 0;
    	float: right;
    	width: 20%;
    }
    
    .sidebar-link {
    	display: none;
    }
    
    .widget-column {
    	width: 80%; /*widget
    }
    
    .one.widget-column {
    	float: none;
    	margin: 0 0 0 40px;
    }
  2. totally untested, just an idea:

    try with CSS:

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

    a clearer way would be to edit the relevant theme templates in a child theme, and adjust the CSS as well.

  3. Ajisai
    Member
    Posted 1 year ago #

    Nope, doesn't work

  4. any styles added after this line width: 80%; /*widget in this style:

    .widget-column {
    	width: 80%; /*widget
    }

    will get treated as CSS comments;

    close that CSS comment properly and retry my suggested CSS fix.

  5. Ajisai
    Member
    Posted 1 year ago #

    Yeah I know,
    Just did a mistake when I copied and pasted the css code.
    The comment is closed, don't worry.

    I did retry your suggested css.
    It doesn't work.
    The menu is gone from the home page but does not appear in the articles.

  6. the suggested CSS is tested and seems to work in a local test setup;
    .home is supposed to make the styles selective to the home page; http://codex.wordpress.org/Function_Reference/body_class

    have you tried to clear the browser cache with 'CTRL F5' or 'reload' ... ?

    can you post a live link to your site?

  7. Ajisai
    Member
    Posted 1 year ago #

    my mistake.

    It does work now, thank you very much.
    If I want to keep the sidebar fixed when I scroll down.
    Any idea where to put position:fixed; ?

  8. Ajisai
    Member
    Posted 1 year ago #

    Here is the link of my website :
    http://www.cbvinylrecordart.com/

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags

No tags yet.