WordPress.org

Ready to get started?Download WordPress

Forums

How do I remove the body margins on the default theme? (7 posts)

  1. nicetechnology
    Member
    Posted 2 years ago #

    Hi all,

    Just installed the latest WordPress and started modifying the new Twenty Eleven theme, and in Firefox there are these incredibly annoying 30-ish pixel gaps on the left and right of the page, which firebug indicates are due to the body margins... but when I look through the CSS for 'body' and all the classes applied to it I see no margins! At least none which aren't overridden. This doesn't happen in IE or Chrome BTW.

    Does anyone know what I'm missing here? It's got to be something simple...

    Thanks in advance!

    J

  2. Rev. Voodoo
    Volunteer Moderator
    Posted 2 years ago #

    First up, if you are actually modifying twentyeleven..... stops please!~!

    Use a child theme http://vudu.me/child

    As for margins...

    body {
    	padding: 0 2em;
    }
    #page {
    	margin: 2em auto;
    	max-width: 1000px;
    }

    THat sets the structure really..... The body is padded on each side, and the overall page gets a max-width

  3. nicetechnology
    Member
    Posted 2 years ago #

    Hey - thanks for the reply. Yea I'm actually modifying it... I know of child themes but haven't used one yet so I'm just gonna have to hack it... it has to be done on Friday...

    BTW I already removed the padding, and #page has a width: 100% in place of the max-width, but Firebug definately shows it's a margin specifically anyway. It's all color coded.

    Any other ideas much appreciated!

  4. Rev. Voodoo
    Volunteer Moderator
    Posted 2 years ago #

    OK, thing is about hacking it.... your changes will be lost. It's a guaranteed thing.

    All I can suggest from here is to post a link to your site and maybe someone can take a gander.....

    Are you using the normal layout? Or is it the one column layout or anything special?

  5. nicetechnology
    Member
    Posted 2 years ago #

    Hey,

    Problem solved! Not sure what it was - probably a caching issue or something - but today it looks fine on all my machines...

    You've got me worried about the theme modification thing though...

    Re: "OK, thing is about hacking it.... your changes will be lost. It's a guaranteed thing."

    I don't intend the client to be updating the theme himself - the site will probably stay static for a long time only updating WP itself for security reasons. This is a really small quick build, just a small publicity site for a very small company, which is why I'm not following the latest conventions - just no time to learn them for this. It won't automatically 'upgrade' my stuff or anything will it? I've copied the theme and renamed it etc. It's not still 'twenteleven' installed. I'm essentially just ripping it apart and modifying a 'blank' theme, which because it is based on twentyeleven, is pretty much guarenteed to be compatible with the latest WP versions. That's okay right? From a stability/security point of view at least, if not from a 'good clean code' perspective?

  6. Rev. Voodoo
    Volunteer Moderator
    Posted 2 years ago #

    Ah ok, if you've renamed twentyeleven to something else, yer good.

    It is, at that point, a new theme, and will not be affected by upgrades to WP in the future. That's pretty much as safe as a child theme. Except that you lose any benefit of twentyeleven being updated in the future.

    For your purposes, it sounds good. Just make sure to drop a new untouched twentyeleven theme into the themes folder at some point. That is pretty much needed for troubleshooting if something flakes out.

    If something goes wrong, and you can't access your site, renaming the active theme, and the plugins folder temporarily, will normally regain access to the site

    But, as of right now, WP does not automatically update. (although clients tend to get jumpy and hit that upgrade warning when it shows up, even if told not to!)

  7. nicetechnology
    Member
    Posted 2 years ago #

    Oh he'll be totally new to modern CMS systems and websites in general, this being a rebuild of a 7-8 year old site. I reckon this guy is gonna need 1-2-3-4 step type instructions from me just to update text on his pages so I doubt he'll be clicking something he doesn't fully understand. I'll tell him not to do anything we haven't talked about specifically just in case...

    Thanks Voodoo!

Topic Closed

This topic has been closed to new replies.

About this Topic