How To: Widen Your Kubrick Wordpress Theme

We Love WordPress

Although I plan on creating my own theme whenever I stumble across some free time, the default Kubrick theme that came with WP suits my needs just fine for now.

Lately I’ve been finding myself wanting to take advantage of the entire width of my blog screen. Elements that get in the way of accomplishing this are obviously the sidebar but also the column width as defined in the CSS.

Fortunately we can take care of that with a simple Page Template. If you’d like to create the occasional wide page and use your existing blog width, read my article on creating a Page Template.

Still Need More Space?

Alright, we still need more room for things like Amazon’s astore so let’s widen our standard Kubrick width from 760 to 800.

Note: Take note of the 40px increase as we’ll use that to adjust div padding and such.

As always, be sure to backup your CSS file (default: styles.css) just in case. I’ll present the following steps in an order you can follow if modifying a production site for minimal disruption.

Modify Some Graphics

Using your favorite editor or even MS Paint, open the following files and increase the image attributes to your desired width.

  • kubrickbg.jpg
  • kubrickbgwide.jpg (this might only be present if you’ve installed the sidebar widget)
  • kubrickfooter.jpg
  • kubrickheader.jpg

Once that is done, extend the image length by cutting off the right size and moving it to the new “right side”. Then copy a middle section of the image and paste it to fill the hole left behind by your initial cut.

If someone knows of an easier way of accomplishing this please share. All it all it isn’t very difficult at all anyway.

Save the new files as a name you’ll recognize to associate with your new width like *_800.jpg or .png (e.g., kubrickheader_800.jpg).

Note: If using MS Paint, you might want to save the image as a PNG to avoid the default JPG dithering that Paint applies to new files.

Edit The CSS

Using the standard Kubick Stylesheet, there are only a few CSS elements you’ll need to modify. Modify your style.css doc by navigating to “Presentation” » “Theme Editor”. Because it’s at the top of the list, “styles.css” should already open up in the editor - if not go ahead and click on the filename to open it.

Note: If you don’t see a button titled “Update File »” then you might need to apply the correct permissions on the server (chmod 660 should work).

Modify the Image References

Point the CSS to the new image files we just created.

Look for the following in your styles.css:

#footer {
 background: #eee url('images/kubrickfooter_800.png') no-repeat top;
 border: none;
}
#header {
 background: #73a0c5 url('images/kubrickheader_800.png')
  no-repeat bottom center;
}

I found the below main bg image (kubrickbg*.jpg) in a condition statement (associated with the sidebar) in my header.css file. References to this image file might be in a different location for you.

if ( !$withcomments && !is_single() ) { ?>
 #page {
   background: url("<?php bloginfo('stylesheet_directory');
    ?>/images/kubrickbg_800.jpg") repeat-y top;
   border: none;
 }
<?php } else { // No sidebar ?>
 #page {
   background: url("<?php bloginfo('stylesheet_directory');
    ?>/images/kubrickbgwide_800.jpg") repeat-y top;
   border: none;
 }
<?php } ?>

Modify the Widths

Change the #headerimg width to your desired size.
The default values had the width as 20px less than the total width (in my case 800) so I left that the same and it worked just fine.

#headerimg  {
 margin: 7px 9px 0;
 height: 192px;
 width: 780px;
}

Change the #page width and #header width to the full size (again, 800 is my desired total width).

#page {
 background-color: white;
 margin: 20px auto;
 padding: 0;
 width: 800px;
 border: 1px solid #959596;
}

#header {
 background-color: #73a0c5;
 margin: 0 0 0 1px;
 padding: 0;
 height: 200px;
 width: 800px;
}

Change the #footer width as well.

#footer {
 padding: 0;
 margin: 0 auto;
 width: 800px;
 clear: both;
}

Adjust Your Content DIVs

Keeping in mind that our new size is 40px greater than the original. Knowing that we can simply widen the content containers to be 40px greater than their existing values.

.narrowcolumn {
 float: left;
 padding: 0 0 20px 45px;
 margin: 0px 0 0;
 width: 490px;
}

.widecolumn {
 padding: 10px 0 20px 0;
 margin: 5px 0 0 150px;
 width: 490px;
}

If you have a sidebar you’ll want to modify the right side padding as well:

#sidebar
{
 padding: 20px 0 10px 0;
 margin-left: 585px;
 width: 190px;
}

And we’re done, hopefully everything draws correctly at this point. I found that I had to adjust the right side of my header image by one pixel to get alignment just right. If I missed anything please post a comment for future readers. Good Luck!

23 Comments

  1. Mathew Needleman
    Posted May 27, 2007 at 7:09 am | Permalink

    Is it possible to add a sidebar to individual posts pages in Kubrick?

  2. Posted May 28, 2007 at 11:53 am | Permalink

    Just add < ?php get_sidebar(); ?> to your single.php template. See this for more details (half-way down): http://codex.wordpress.org/Customizing_Your_Sidebar

  3. Ed
    Posted May 31, 2007 at 5:33 pm | Permalink

    Thank you this worked for me!

  4. Posted June 1, 2007 at 10:36 pm | Permalink

    Would you happen to know how to get the header image (which I believe is a background image) of kubrick to be a link back to main page of the blog? I believe it used to function this way but now it no longer works.

  5. Posted June 5, 2007 at 7:52 am | Permalink

    Hi Ed, sorry for the delay in responding to you.

    The default installation only sets the blog title within the header image as a hyperlink. You can edit this or verify that it is setup by going into your theme editor and opening up header.php (of the default theme).

    Look for this:
    <div id=”header”>
    <div id=”headerimg”>
    <h1><a href=”<?php echo get_option(’home’); ? rel=”nofollow”>/”><?php bloginfo(’name’); ?></a></h1>
    <div class=”description”><?php bloginfo(’description’); ?></div>
    </div>
    </div>

    On the other hand if you want the entire image to be a hyperlink then you could probably get away with moving the href anchor to enclose <div id=”headerimg”>……..</div>

  6. Ed
    Posted June 5, 2007 at 5:25 pm | Permalink

    You are so helpful but my header as a link is still not working. I do have what you said I should have but no luck. Care to take a look?

    >

    ; charset=” />

    » Blog Archive

    ” />

    ” type=”text/css” media=”screen” />
    RSS Feed” href=”" />
    ” />

    #page { background: url(”/images/kubrickbg-.jpg”) repeat-y top; border: none; }

    #page { background: url(”/images/kubrickbgwide.jpg”) repeat-y top; border: none; }

    /”>

  7. Ed
    Posted June 5, 2007 at 5:25 pm | Permalink

    It wouldn’t let me post all of it. Here’s the key part, I think:

    /”>

  8. Posted June 5, 2007 at 8:56 pm | Permalink

    Ed, I took a look at your blog and didn’t see an href anywhere in the header. Are you able to edit header.php? You might have to change the permissions before being able to save changes. WP should display a messages regarding this if it is in fact the case.

  9. dee
    Posted June 13, 2007 at 12:22 am | Permalink

    Hi there thanks for this useful tutorial. I’m trying to remove the sidebar completely from my blog and so far I have removed all the menu options in the side bar. And it’s leaving a huge blank space in the sidebar. I would like to remove this sidebar space. How would I do that?

    thanks.

  10. Posted June 13, 2007 at 10:07 am | Permalink

    Hi Dee, Rather than removing the items within the sidebar I would remove any calls to the sidebar itself. I can take a look at Kubrick (I’m assuming that’s your theme) and see what exactly you need to remove but chances are than in addition to eliminating the calls, you are also going to have to increase the width of your widecolumn style to match the width of your blog. Let me know if I can help more and I’ll do some digging.

  11. Posted June 13, 2007 at 4:38 pm | Permalink

    Hi Jason. Cheers. I attached my web address. I seem to have got rid of the side bar by shrinking it in width then widening the contents area. However, if you click on one of the comments the layout of the site is corrupted. Would you help me to correct this issue?

  12. Posted June 13, 2007 at 4:47 pm | Permalink

    Hmmm a quick look at your stylesheet reveals that .widecolumn has a left margin of 150px. The order of values reads top, right, bottom, left.
    .widecolumn {
    padding: 10px 0 20px 0;
    margin: 5px 0 0 150px;
    width: 680px;
    }
    I’d try changing this value to 10px or so. I find it helpful to temporarily add a border=1 or apply a background color to divs when troubleshooting something like this; you might want to do the same. Good luck!

  13. Posted June 13, 2007 at 8:24 pm | Permalink

    Thanks Jason. I changed it to 20px and that did the trick!

    I appreciate your help and I have one more question related with css. The site displays fine in fireox but older IE the menu are far offset in position. Do you think you can help me fixing this issue?

    In IE, it creats anotehr big square table where menu are places above the headbanner..

    thanks.

  14. Posted June 15, 2007 at 3:05 pm | Permalink

    Ack.. cross-browser debugging. Sorry Dee, that’s probably a bit too hard to debug without getting my hands on the code.

    I recommend that you load your theme in IE in an unaltered state and verify that it does in fact display correctly. Assuming it does, you should then step through your changes again one my one to determine what hacks are causing the problem(s). Once you determine that you should be able to Google known solutions. Good Luck!!

  15. Posted September 24, 2008 at 9:11 am | Permalink

    I did what you said and it worked. Then I decided to use another banner which is a little bigger (longer) I made the changes in stylesheet but it still wont change. Confused.

  16. Posted November 5, 2008 at 6:06 pm | Permalink

    I would like to see the inscription “to be continied”:-D

  17. Posted December 18, 2008 at 11:08 pm | Permalink

    Thanks very much! This was very helpful. The part about the right-side padding of the sidebar could have been a bit clearer (as to which number had to be increased), but I figured it out. Thanks again!

  18. Posted July 6, 2009 at 8:54 am | Permalink

    TtlxKb Hi can someone please translate for me thanx,

  19. Posted July 6, 2009 at 8:54 am | Permalink

    great tips. I enjoyed reading this,

  20. Posted July 6, 2009 at 8:55 am | Permalink

    cool, i will bookmark it,

  21. christian
    Posted July 16, 2009 at 4:52 pm | Permalink

    Great article, unfortunately there doesn’t seem to be a kubrickbg.jpg in my kubrick theme. Help!

  22. robert
    Posted January 30, 2010 at 5:14 pm | Permalink

    Not bad! Thanks

  23. Posted February 1, 2010 at 1:26 pm | Permalink

    Thank you for this, and especially, thank you for following-up and answering questions. I have wanted to do this for a long time and finally did it–actually, I cheated and found two different examples where the pictures had already been edited.

    My problem is I really would like to have the original grey shading in the right column. I have not seen a wider version that has retained this. Is there a way to do it without doing it through the jpegs?

    Also, I have never understood the “narrowcolumn” “widecolumn” business. I’d like to make the post body as wider…

    Thanks!

4 Trackbacks

  1. By nude womens videos on August 25, 2008 at 8:07 am

    free pictures of nude womens…

    On this blog you can find all celebrity nude women gallery

  2. [...] Adjust width of columns:  i.ndustrio.us » How To: Widen Your Kubrick Wordpress Theme [...]

  3. By Inauguración | Javi Besga on February 18, 2009 at 11:13 am

    [...] También he modificado el tema del blog, para aumentar su anchura a 800 píxeles siguiendo esta guía: How To: Widen Your Kubrick WordPress Theme. [...]

  4. By Wordpress Themes – theResearchSource.net on February 1, 2010 at 10:53 pm

    [...] call it Kubrick, and I finally have it more or less the way I want it.  This site has instructions on how to widen [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*