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 5 months 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. alchymyth
    The Sweeper & Moderator
    Posted 5 months ago #

    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 5 months ago #

    Nope, doesn't work

  4. alchymyth
    The Sweeper & Moderator
    Posted 5 months ago #

    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 5 months 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. alchymyth
    The Sweeper & Moderator
    Posted 5 months ago #

    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 5 months 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 5 months ago #

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

Reply

You must log in to post.

About this Theme

About this Topic

Tags

No tags yet.