WordPress.org

Ready to get started?Download WordPress

Forums

Creating a no sidebar page template for Dirty Blue theme (9 posts)

  1. gaidin
    Member
    Posted 3 years ago #

    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

  2. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    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?

  3. gaidin
    Member
    Posted 3 years ago #

  4. tigtog
    Member
    Posted 3 years ago #

    Your link didn't come through

  5. gaidin
    Member
    Posted 3 years ago #

    just edit it:)

  6. tigtog
    Member
    Posted 3 years ago #

    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)

  7. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    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

  8. gaidin
    Member
    Posted 3 years ago #

    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.

  9. ramp2677
    Member
    Posted 3 years ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Topic