WordPress.org

Ready to get started?Download WordPress

Forums

How Do You Add/Subtract Sidebars to/from a Theme (5 posts)

  1. mythusmage
    Member
    Posted 8 years ago #

    Explain in your reply, with no links to any other page, how to add/subtract sidebars to/from a theme. What change or changes to the style sheet code need to be made? Put everything necessary into your reply.

    (If I knew how I'd say so, but I don't so I can't.)

  2. Ryan Fitzer
    Member
    Posted 8 years ago #

    A good start is to look at the code in your theme's sidebar.php file and get familiar with it. For example, after the funtion is_home() you can see what is included on your home page sidebar. The titles of which should (might) be contained between <h2></h2> tags and the links or text contained between <ul></ul> tags. If you would like to get rid of that section you can just delete everything between those tags (including the tags), or simply make it an HTML comment by putting <!-- at the beginning of the section and --> at the end. This way you can always use it later if you change your mind. To add a section to the sidbar on another page, copy and paste the section's code under the function that controls what shows up in the sidebar.

  3. Michael Bishop

    Posted 8 years ago #

    ryanfitzer, I don't think the OP wants to add or subtract content from a sidebar, they physically want to add or subtract the sidebar column.

    Which is, IMO, far and beyond the scope of a WP support forum post, which, IS, from what I can gather, what the OP wants.

    The answer is more CSS based than WP. The issue is about how the page is displayed, relative to widths, either in pixels or %, and the overall width of the page. It's not as simple as adding an additional PHP include to add another file worth of content. You must really dissect the style sheet and determine what and where you can add another column, THEN, you could do a <?php include 'sidebar2.php'; ?> to add your additional content.
    Since you don't want links, I won't bother adding any to CSS references I would suggest.

    I'll add that deleting content might be easier, bu t the display could just as easily be borked by doing so, depending on the theme.

  4. Ryan Fitzer
    Member
    Posted 8 years ago #

    Misread that one, sorry. I agree, putting in or taking out the whole sidebar would be a big redesign depending on the theme.

  5. spencerp
    Member
    Posted 8 years ago #

    ryanfitzer, it's ok, that happens to everyone sometime lol. But, to the O.P., you "could" always use a Single Col theme, and then do like miklb basically said, just call up or have the sidebar on other pages, that you'd want the sidebar to be on or whatever maybe..

    I'm not sure though, just throwing out ideas.. =P

    spencerp

Topic Closed

This topic has been closed to new replies.

About this Topic