Forums

[closed] I need the sidebars on my posts but not on my pages. How do I do this? (16 posts)

  1. powerleg
    Member
    Posted 2 years ago #

    I need to turn off the sidebars for my pages but leave both on for my posts. Could someone smarter than me help me do this please?

  2. Samuel B
    moderator
    Posted 2 years ago #

    create a Page template(s) and leave off the call for a sidebar
    use created Page template for pages
    http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates

  3. powerleg
    Member
    Posted 2 years ago #

    Thanks, I followed the instructions on the wordpress page but it didn't work. I hate to have a site with no sidebars but I may have to. PHP is just not my cup of tea.

  4. Samuel B
    moderator
    Posted 2 years ago #

    thousands have used those instructions without problems
    what do you mean "it didn't work"?

  5. powerleg
    Member
    Posted 2 years ago #

    It goes to a syntax error instead of the page. I removed the code and it goes to the page.

  6. Samuel B
    moderator
    Posted 2 years ago #

    are you creating a completely new template in this format?

    <?php
    /*
    Template Name: Snarfer
    */
    ?>

    Then uploading it to your theme files?

  7. powerleg
    Member
    Posted 2 years ago #

    No, I just added that code to the existing page template so it would hopefully lose the sidebars on all pages, but not posts.

  8. Samuel B
    moderator
    Posted 2 years ago #

    won't work
    you need to create a new template with above format
    "snarfer" is whatever you want to name the template
    you can use page.php for examples of how to call the footer and header

  9. powerleg
    Member
    Posted 2 years ago #

    Oh, I don't know how to do all that. Sure wish you could do this from the dashboard settings.

  10. Samuel B
    moderator
    Posted 2 years ago #

    not possible

    do this - copy this info into notepad

    <?php
    /*
    Template Name: new-page
    */
    get_header(); ?>
    <?php get_footer(); ?>

    save it as new-page.php

    upload it to your current theme files

    go to your wordpress admin - Page - new page

    make a test page and from drop down box on right, choose new-page template
    save page
    view page
    how much else do you want to add to it?

  11. powerleg
    Member
    Posted 2 years ago #

    I did that and got the new page up but it still has the sidebars. I just went ahead and turned the sidebars off for the whole site.

  12. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Perhaps your sidebars are being called within header.php?

  13. powerleg
    Member
    Posted 2 years ago #

    I looked on header.php and didn't see where it said sidebars anywhere. I don't know.

  14. Samuel B
    moderator
    Posted 2 years ago #

    man how did it pull sidebar when it's not called in the template?
    good luck

    edit - found this plugin but can't vouch for it
    http://www.bin-co.com/tools/wordpress/plugins/article_templates/

  15. powerleg
    Member
    Posted 2 years ago #

    Thanks anyway for your help. I'll just have to settle for a sidebarless limited navigational site I guess, with emphasis on the back button.

  16. krystofo
    Member
    Posted 1 year ago #

    I know this thread is a year old--but it's still showing up prominently in discussions for the Starscape theme--and has some noteworthy information! Just thought I would mention this unworthy quick-and-dirty method to remove sidebars or anything else on any specific page or post. (Not recommended if you can do the other methods, but it works.) As you probably know, display:none is typically used to remove side menus in a printer-friendly print.css style sheet which every webpage "should" reference (but many do not). "Edit" every page, click the HTML tab and add this at the top. If "#sidebars" removes too much, view-source for more precise #id or .class. If you want anything else to disappear, other comma-separated .classes and #id's may also be added, of course.

    <head><style>div#sidebars {display:none}</style></head>

Topic Closed

This topic has been closed to new replies.

About this Topic