Forums

Eliminating right sidebar, only on one page (16 posts)

  1. jgmash
    Member
    Posted 2 years ago #

    I want to eliminate the right sidebar on only one page of a three column template.

    I created a private page that loads a script that bleeds over the right sidebar. I am at the minimum frame width of the script.

    It would be perfect if I could code out this sidebar, only on this page, and be able to use this script.

    Any thoughts? Is this even possible?

  2. stvwlf
    Member
    Posted 2 years ago #

    yes its done all the time, through adjusting the CSS. the generic answer is in the PHP, if you are on that page, apply a class to the body or content DIV that indicates that page. Then in the CSS when that class is active apply display:none to the right sidebar. If you are saying the left sidebar is next to the right sidebar and you want it wider, when that same class is active, in the stylesheet change the width of the left column.

    If you need assistance implementing this, post a URL to that page. I realize it is private. See if you can find a way to temporarily display it on the web.

  3. jgmash
    Member
    Posted 2 years ago #

    What I am doing is putting a google search box in my footer and have the search engine open on my site within the private page I created.

    Does that make sense?

  4. adamcorley.com
    Member
    Posted 2 years ago #

    Yes. On my website, http://adamcorley.com, I have the same thing going on.

    Go do a search query, it puts you to http://adamcorley.com/search.

    And there are no sidebars.

    Could you specify what you're doing?

  5. jgmash
    Member
    Posted 2 years ago #

    Adam,
    yep, that's what I'm talk'n bout.
    How did you eliminate your sidebars?

  6. adamcorley.com
    Member
    Posted 2 years ago #

    This isn't as hard as it seems:

    Use your FTP client and open your themes file up. Open your single.php file up. Copy the contents.

    Make a new text file with NotePad or whatever text editor you use. Paste the contents into the file.

    You must do this perfectly:

    Remove your sidebar php tags:

    <?php include "leftmenu.php"; ?>
    <?php get_sidebar(); ?>

    They will look like the above if you have two sidebars. If only one, then only remove the second tag.

    Save that to your theme's folder as nosidebar.php

    Go to the admin dashboard, then to the page you're wanting to do this to. On the right side, instead of default template, pick nosidebar.php

  7. jgmash
    Member
    Posted 2 years ago #

    I don't have a single.php file within in the theme I am using..
    darn it that sounded so easy.

  8. Devin Price
    Member
    Posted 2 years ago #

    If you don't have a single.php file, it means your theme is defaulting to index.php. You can follow adamcorley's advice above, but use index.php instead of single.php.

    You could also set up conditional statements, which is more difficult, but would be useful if you want to exclude multiple pages/posts through the code. You would replace <?php get_sidebar();> in the index.php with the following code. Instead of page-slug, your would put the actual page slug for the page you didn't want to have the sidebar.

    <?php
    
    global $post;     // if outside the loop
    
    if (is_page('page-slug') {
        // Do nothing 
    
    } else {
        get_sidebar();
    }
    ?>
  9. jgmash
    Member
    Posted 2 years ago #

    I have no calls to the sidebar in my index.php ?

  10. adamcorley.com
    Member
    Posted 2 years ago #

    Tell me all of the files within your themes file and I'll tell you which one to edit.

  11. jgmash
    Member
    Posted 2 years ago #

    images
    comments-popup.php
    comments.php
    footer.php
    functions.php
    header.php
    index.php
    sidebar_first.php
    sidebar_second.php
    style.css

  12. adamcorley.com
    Member
    Posted 2 years ago #

    Check your index.php folder again. The php tags should be at the very bottom

  13. adamcorley.com
    Member
    Posted 2 years ago #

    Wait. Just upload a copy of your theme to megaupload.com and give me the link and I'll look around. If I can find it, I'll give you the new copy.

  14. jgmash
    Member
    Posted 2 years ago #

    had problems uploading @megaupload.com, I have to run to a meeting,
    Drop me your email and I will send the file to you.
    kite me at....admin(at)my68flh.com

  15. jgmash
    Member
    Posted 2 years ago #

    Adam, just sent you the megaupload link,
    thanks for your time on this, I just want to eliminate the right sidebar on one page (mydomain.com/search).

  16. jgmash
    Member
    Posted 2 years ago #

    Adam haven't heard anything from you..this is still unresolved, anyone else out there?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags