• Resolved lexavision

    (@lexavision)


    Hi,

    I need to craete 4 custom pages all of which do not need the sidebar from the theme I’m using. I guess I need to create a custom.php, but I need the 4 pages to be able to recognize it. I haven’t found a solution online as of yet.

    Thanks!

Viewing 11 replies - 1 through 11 (of 11 total)
  • How to assign a custom page template to a WordPress page:
    http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates

    In your custom page template, you would have no sidebar, and the contents area would be a different width than the rest of your site.

    Thread Starter lexavision

    (@lexavision)

    I made the custom page and put in the themes directory cut I coudn’t see it in the themes selection.
    I then made a separate directory. Now I see the new theme but the sidebar and footer are still displaying even though I’ve commented these out.

    Did you put a header like this on your custom theme page?

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

    It won’t work without it. If you have not assigned the custom template to the WordPress page in the WordPress editor then the new template is not going to be used to display your page.

    Thread Starter lexavision

    (@lexavision)

    So what I tried was to make another directory under /themes. I modifed both the page.php and index.php to not show the sidebar and footer. This seems to have given me the desired result.

    Do you know if this appraoch will interfere with anything?

    Thanks!

    if you make another directory under /themes/ you are basically creating a new theme.

    I realize you have not done what you are after and it may seem difficult, but in the scheme of things WP, it is very simple when you do it the intended way. you just have to follow 4 or 5 steps that are documented in that page I linked you to. Then it will work the first time.

    This tutorial is from an earlier version of WP but it will work with the current also – just different admin page layout
    Creating A Custom WordPress Page – Removing Sidebar and Footer
    http://www.wpthemesplugin.com/creating-a-custom-wordpress-page-removing-sidebar-and-footer/

    Thread Starter lexavision

    (@lexavision)

    Thanks stvwlf,

    Still not being displayed as a theme option.

    What I’ve done.

    -go to my theme directory /themes/lexavision
    -make a copy of page.php and call it custom.php
    -Add to the top:
    <?php
    /*
    Template Name: custom
    */
    ?>

    Comment out Header and footer:

    <!–?php get_sidebar(); ?–>
    <!–?php get_footer(); ?–>

    This file is still in the /themes/lexavision directory.

    Go to Themes in WP and unfortunately I don’t see the “custom” theme.

    Am I screwing up here?

    no you are not grasping this yet

    you are not making a new theme
    you are adding one custom page to your existing theme.
    that custom page has to be associated with specific wordpress static pages in the WP editor.

    go into the wordpress editor and create a page on which you want the content to display with no sidebar or footer

    To the right of the edit window is a section called Attributes.
    There is a pulldown in that section labelled Template.
    In the pulldown you should now see “custom”. select that and now update the page. Now, any content you enter in the editor on that page should display ON THE WEBSITE with no sidebar or footer.

    You will still need to make a CSS adjustment to have your content column be as wide as the full page width since it will be leaving space for the sidebar that is not there.

    In the custom template you made I suggest setting up the content line like this <div id="content" class="wide">

    then you can assign CSS to #content.wide that will override the normal css for #content – there you can make it 800px wide or whatever you need.

    #content {
    ...
    width: 550px; /* this will be overriden by the styling in the next group */
    ...
    }
    #content.wide { width: 800px; }

    Thread Starter lexavision

    (@lexavision)

    Great!!! Thanks a bunch stvwlf.

    Hi there!

    I am having the same problem. I have created the custom page, without the sidebar, the only thing I haven’t managed to do is to make the content part of the page wide so as to cover the empty space left by the removed sidebar.

    I’d be so grateful if someone could take a look at my site here and give me a hint.

    Thanks!

    Thank you 🙂 🙂

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘How to Create Custom with no Sidebar’ is closed to new replies.