WordPress.org

Forums

[resolved] How to Create New Page Template without Sidebar (23 posts)

  1. gandrew55
    Member
    Posted 3 years ago #

    I know this is very basic, but I need a bit of help...
    I am adding Forums to my blog, The Discerning Photographer, (theme is Mimbo 3.0) and I
    need to remove the sidebar from the new Forum page:
    http://thediscerningphotographer.com/forum/

    I tried duplicating my page.php file and simply removing the line that calls the sidebar; this errored out the whole page.

    Any simple instructions about how to proceed greatly appreciated!!

  2. Michael Arestad
    Member
    Posted 3 years ago #

    Does your theme have a single column layout by chance? When you are editing a page, you can select the layout via drop down menu on the right.

  3. Andrei Olsen
    Member
    Posted 3 years ago #

    copy page.php, rename copy as page-forum.php or page-ID.php, where ID is id of the forum page, and remove the line with <?php get_sidebar(); ?>.

  4. gandrew55
    Member
    Posted 3 years ago #

    My theme does NOT have a single-column layout in the pulldown list.

    And Andrei, I did what you suggested--at least I think I did, although I called it fullwidth.php, created using Dreamweaver with a simple copy and paste but adding these five lines to the top:

    <?php
    /*
    Template Name: Full Width Template
    */
    ?>

    I took out the

    <?php get_sidebar(); ?>

    and saved out my changes and uploaded to my theme, producing the error.

  5. gandrew55
    Member
    Posted 3 years ago #

    Here's the page as it is now, but producing the errors:

    [code moderated - please follow the forum guidelines for posting code]

  6. rahendz
    Member
    Posted 3 years ago #

    try this..

    [code moderated - please follow the forum guidelines for posting code]

    i just remove the

    if (have_posts()) : while (have_posts()) :

  7. Andrei Olsen
    Member
    Posted 3 years ago #

    It works just fine. What kind of errors?

  8. gandrew55
    Member
    Posted 3 years ago #

    Here's what it's doing: when I go to the Page, go to Edit, use the pulldown and choose 'Full Width Template', Update my changes and go to 'View Page,' it returns a page that just displays all of
    the php coding for the page, rather than producing the actual page...

  9. rahendz
    Member
    Posted 3 years ago #

    It works just fine. What kind of errors? — Andrei Olsen

    yep, fine for me either..

    displays all of the php coding for the page

    what do you mean by that?

  10. gandrew55
    Member
    Posted 3 years ago #

    I mean that when I click on the tab for the page, I don't get the page displayed. I get all of the php coding displayed, as if I was in the theme editor.
    When I switch the page over the the 'Default' template, with the sidebars I don't want, the page displays properly.

  11. gandrew55
    Member
    Posted 3 years ago #

    This link shows what I'm getting:
    http://thediscerningphotographer.com/forum/

  12. Andrei Olsen
    Member
    Posted 3 years ago #

    Maybe Dreamweaver messed up and interpreted php code as html markup and changed it so. I hope you pasted the code in code view and not visual/wysiwyg mode.

    Did you try opening and editing php file with notepad or another editor ( like vim or notepad++. The last one would probably be better for you)?

  13. gandrew55
    Member
    Posted 3 years ago #

    Andrei,
    Thanks! Partial resolution of my problem. I tried working directly in my page-forum.php file and simply doing an 'Update File' and now it's properly showing the page!
    HOWEVER: It's still only using the 620 px of the 920px that Mimbo defines. This is the width of the 'Content' in the stylesheet.

    Here's a link to the entire Mimbo stylesheet:
    http://pastebin.com/ce1gg3N9

    Is there a way I can define something different for my page-forum template?

    Thanks to all who have contributed to this, I really appreciate your help.

  14. Andrei Olsen
    Member
    Posted 3 years ago #

    Just add #post-4038 { width:910px; } to your stylesheet.

  15. rahendz
    Member
    Posted 3 years ago #

    or this..

    .page-template-page-forum-php #content{width: 910px !important;}

  16. Andrei Olsen
    Member
    Posted 3 years ago #

    You don't need !important there.

  17. gandrew55
    Member
    Posted 3 years ago #

    Can you tell me exactly where to place this in the stylesheet, Andrei?
    Would it go inside the existing content brackets, below the regular specification for 620px content for everything else, or inside its own brackets, or where?
    Sorry, I know this is incredibly basic.

    Incidentally rahendz, I tried making the change in the forum-php file as you suggested but the content stayed 620px...

  18. esmi
    Forum Moderator
    Posted 3 years ago #

    Try adding it to the bottom of style.css.

  19. gandrew55
    Member
    Posted 3 years ago #

    OK, adding #post-4038 { width:910px; } to the bottom of the
    stylesheet does not seem to work. My content on that page remains at 620px.

  20. Andrei Olsen
    Member
    Posted 3 years ago #

    It doesn't matter where you place it, since it isn't used anywhere, but as esmi suggested place it at the bottom of your stylesheet. In Mimbo it would be right after rss{}.

    I can't seem to see that you changed your css file. Are you sure you overwrote the file?

  21. gandrew55
    Member
    Posted 3 years ago #

    Here's a link to the css file with the code pasted at the bottom.

    http://pastebin.com/MJLPYSL7

    Is it possible that the 'Content' tag is taking precedence over this addition for this page?

    My page is still conforming to the 620px content well.

    http://thediscerningphotographer.com/forum/

  22. Andrei Olsen
    Member
    Posted 3 years ago #

    The page looks fine now. You likely looking at the cached version. Refresh cache with Ctrl-F5 or just delete browser's cache.

  23. gandrew55
    Member
    Posted 3 years ago #

    EUREKA! THANKS TO ALL WHO HELPED SOLVE THIS ISSUE FOR ME!

    Well done!

    Andrew

Topic Closed

This topic has been closed to new replies.

About this Topic