SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Zealot tim@getdim's Avatar
    Join Date
    Jul 2012
    Location
    Detroit
    Posts
    163
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry Wordpress Site Static Front Page alignment issue

    Hello all.

    I am having an issue with a site i am building in Wordpress.
    Im using a static front page. For reasons unknown to me my entire front page is now aligned left, while the rest of the site is centered as it is supposed to be.
    I cant figure out what i could have done to cause this.
    It was perfectly fine (centered) when i logged off one day, and the next day when i visited the site again the front page had shifted left.
    I cant figure out how to correct this in the css without negatively affecting the other pages.

    Anyone have any idea how this could have happened?
    the site is on my testing server: mydomainsample.com/ai

    i can post any code either in this thread or in a private message on these forums.

    Thanks in advance.

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,199
    Mentioned
    456 Post(s)
    Tagged
    8 Thread(s)
    This line in your CSS is causing the problem:

    Code:
    .home {
    width: 60px;
    }
    Remove that and all swell. What was that line of code meant to achieve?

  3. #3
    SitePoint Zealot tim@getdim's Avatar
    Join Date
    Jul 2012
    Location
    Detroit
    Posts
    163
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    What was that line of code meant to achieve?
    it was meant to specify the width of the home button in the navigation.
    I dont understand why that would move the page left, but thanks for the help. i never would have guessed that.

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,199
    Mentioned
    456 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by tim@getdim View Post
    it was meant to specify the width of the home button in the navigation.
    Ah, but the class was applied to the body element, meaning that you wanted the whole page to be only 60px in width. Luckily, the content peeked outside that enough to be seen.

    To apply a width to a button, apply a class directly to the button.

  5. #5
    SitePoint Zealot tim@getdim's Avatar
    Join Date
    Jul 2012
    Location
    Detroit
    Posts
    163
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i did apply the class directly to the button. the home button in the nav was <li class="home">.
    how did it get applied to the body element? is that something that was written into the template or Wordpress itself?
    i wrote the css class specifically for the nav and applied it as i stated. I didnt apply it to anything else - at least not intentionally.

  6. #6
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,199
    Mentioned
    456 Post(s)
    Tagged
    8 Thread(s)
    Ah, I see. The template you are using already has a class of "home" applied to the <body> element:

    Code:
    <body class="home page page-id-17 page-template-default custom-background">
    I guess you have to be careful with things like that if using a template made by someone else. Perhaps choose less obvious classes like "hme" or "home-button" just in case.

  7. #7
    SitePoint Zealot tim@getdim's Avatar
    Join Date
    Jul 2012
    Location
    Detroit
    Posts
    163
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    gotchya. Thanks again

  8. #8
    SitePoint Member
    Join Date
    Jan 2013
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm having the same problem. My page is centered and looks fine, then I set it as the front static page for my website and suddenly its all shifted to the left of the screen. Anybody have any answers?

  9. #9
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,199
    Mentioned
    456 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by Gskinner View Post
    I'm having the same problem. My page is centered and looks fine, then I set it as the front static page for my website and suddenly its all shifted to the left of the screen. Anybody have any answers?
    If we see a link, it should be easy to answer.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •