WordPress.org

Support

Support » How-To and Troubleshooting » Creating a no sidebar page template for Dirty Blue theme

Creating a no sidebar page template for Dirty Blue theme

  • I am trying to create a template page with no sidebars for the Dirty Blue theme found in Wpress theme directory.

    I have successfully created a new template called nosidebar by editing the page.php file.

    I removed the line that calls/insert the sidebar and now no sidebar,

    what I am having difficulty with is CSS, to adjust the width of the main area to now span where the sidebar use to be.

    Can someone please help

Viewing 8 replies - 1 through 8 (of 8 total)
  • Michael
    Forum Moderator

    @alchymyth

    what I am having difficulty with is CSS, to adjust the width of the main area to now span where the sidebar use to be.

    for help with any formatting/css issues, a link to the live site with the problem is needed.

    link to your site, to a page without sidebar?

    tigtog
    Member

    @tigtoggmailcom

    Your link didn’t come through

    just edit it:)

    tigtog
    Member

    @tigtoggmailcom

    OK, looking at it in Firebug, the width of your content on your normal page.php is controlled by <div id="leftcolumn">.

    Do NOT change #leftcolumn in your style.css right now – you will change the width on all your other posts and pages.

    What you need to do on your no-sidebar page-template is change the bit where it says

    <div id="leftcolumn">

    to say <div id="fullwidth">

    and then you can add a block of styling to your style.css for #fullwidth (I suggest copying the styling code for #leftcolumn exactly and then changing only the width)

    Michael
    Forum Moderator

    @alchymyth

    as the theme uses body_class(), there is no need to edit any css ids in the template; it can all be done by using the css class output of body_class();

    for example, add these new styles to style.css of your theme:

    .page-template-pagenosidebar-php #leftcolumn,
    .page-template-pagenosidebar-php .post,
    .page-template-pagenosidebar-php .post-header,
    .page-template-pagenosidebar-php .post-meta { width: 100%; }
    
    .page-template-pagenosidebar-php blockquote { width: 850px; }

    everytime you use the template without sidebar, this css should stretch the content to full width.

    http://codex.wordpress.org/Function_Reference/body_class

    Thank you to both tigtog and alchymyth. I used alchymyth’s because it was a simple cut and paste but could tell both would work.

    Hello Everyone, I would like to do the SAME exact thing, but I am using the Yoko theme. Is the process essentially the same? I have not altered anything, except to remove the sidebars from the page using the editor. I do not want ANY sidebars on ANY of my pages.

    Any help you can give would be greatly appreicated!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Creating a no sidebar page template for Dirty Blue theme’ is closed to new replies.