WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Sidebar is below content on homepage - fine everywhere else! (15 posts)

  1. trich1
    Member
    Posted 2 years ago #

    Hi everyone!

    I have been at this problem for about two or three weeks now and I just can't solve it!

    I tried installing BuddyPress, and bbPress and had to modify my template files, then decided against using them so I got rid. Through all this I kept my homepage locked out and had visitors directed to my About page whenever they wanted to go home.

    So, once my site was looking fine on all the available pages, I finally unlocked the homepage, only to find that somehow my sidebar has shifted and my footer is out of alignment!

    My page is at http://tokyoclock.co.uk

    What happened there?! I guess it's to do with a misplaced div, but where? And more to the point, which file do I need to edit?

    I looked all over this forum, a few people have managed to solve a similar problem by adding or removing divs at the sidebar command on page.php, but I tried that and got nowhere. I tried on page.php, index.php, home.php, and couldn't find what I was looking for on style.css.

    Each of the above files have the same sidebar and footer commands, which is presumably correct since it's absolutely fine on all the other pages of my site, just the homepage has gone CRAZY.

    Any help would be hot!

    Thanks so much,

    Tim.

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

    you have a few validation errors on the page: http://validator.w3.org/check?uri=http%3A%2F%2Ftokyoclock.co.uk%2F&charset=%28detect+automatically%29&doctype=Inline&group=0

    particular the ones with 'end tag for "div" omitted' and 'end tag for element "div" which is not open'

    start by fixing these errors - possibly in index.php (?)

    http://codex.wordpress.org/Validating_a_Website

    even the 'products page' (example only, as i haven't checked any other pages) which shows properly has some errors:
    http://validator.w3.org/check?uri=http%3A%2F%2Ftokyoclock.co.uk%2Fproducts-page%2F&charset=%28detect+automatically%29&doctype=Inline&group=0

  3. trich1
    Member
    Posted 2 years ago #

    Thanks @alchymyth!
    I will take a look through index.php and try to sort out these errors.

    This theme has given me trouble at almost every turn - I have a feeling a lot of those errors are either left over from getting rid of BuddyPress and bbPress or were simply built into the theme. It's a pain because I like this theme, it just doesn't want to make life easy for a novice like me!

    I'll get back to you on what I find!

  4. trich1
    Member
    Posted 2 years ago #

    I have no clue..

    So the validator is good, I now know the issues that need correcting, and the helpful validator has even given me the ideal code to replace it with.. But the right file to edit seems to be evading me completely! I've looked all over my theme folder and can't seem to find the code this validator is telling me to look for at all.

    So I went to Firebug Lite to see what that can tell me, and I can see exactly where I need to put a </div> - It looks like somehow my sidebar has made its way into my content, so a div needs to be put there to separate them both.

    Once again though, can't find the file I need to edit (I think it's the same file). So I could gladly kill two birds with one stone if this fabled file that all these things keep reading would come to light for me.

    I sound so dim. I must be being really stupid with this, but I just can't figure it out =S

  5. johnfotios
    Member
    Posted 2 years ago #

    On the dashboard, go to pages and check your home page content. You might have put in a <div> without closing it.

    that's all I can think of right now XD

  6. trich1
    Member
    Posted 2 years ago #

    Alas, I thought of that yesterday, only to find that 'Home' isn't listed in my Pages menu. It's a bit crazy eh!

    I can tell I'll be bald by Monday thanks to this =P

  7. tomcos
    Member
    Posted 2 years ago #

    I am having the exact same problem! I have been searching everywhere but with no success...does anyone else have any recommendations? :D

    Goin crazy over this one!

  8. trich1
    Member
    Posted 2 years ago #

    Glad I'm not the only one! I'm still tearing my hair out over this one but I haven't had a chance to do a lot of playing around with it over the weekend. A friend of mine thinks it might be to do with the header / logo code, he said to remove that and see if it changes anything - it didn't for me but might work for you!

    Also, I made a backup of my site and then deleted the theme from WordPress and reinstalled it a fresh. Now, while it was set to another theme everything was fine, but once back to my normal theme it happened again. I'm not sure why this is because when I installed the theme in the first place it was perfect!

    I have read elsewhere on the forum that it could sometimes be caused by your sidebar widgets, so removing them will be my next task when I get a few moments. But frankly, this one's got me totally baffled. I'm not tremendously clued in with coding and just learning as I go along, but honestly this just seems completely illogical. The worst thing being that the command to call the sidebar is the same on all the pages, so I don't see why it is broken on just my homepage.

    Once again, anyone who can help... Y'know, don't be a stranger =)

  9. tomcos
    Member
    Posted 2 years ago #

    Wait it's broken on your homepage? Mine is only broken on my buddypress pages lol...which leads me to believe it may very well be a incorrect div tag...which I might go test today...

  10. peredur
    Member
    Posted 2 years ago #

    The reason why your sidebar shifts down is because there is not room for it beside the content:

    pbody width == 900px - (50 left + 50 right padding) = 800px
    content width == 550px + 10px margin = 560px

    This leaves 240px for your sidebar.

    Your sidebar is 317px + 12px margin = 329px.

    If you take the width specification off the content, the sidebar moves up.

    You also have two divs with the id of "content" this is invalid. Either change one of the ids or change it to a class.

    HTH

    PAE

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

    @trich1
    something to start with:

    the front page template has the code <div id="content"> twice; find where these are - possibly in index.php.
    and delete the second one.

    @tomcos
    please start a new topic, and post a link to your site.

  12. tomcos
    Member
    Posted 2 years ago #

    Peredur,
    Thanks for the response to the thread :)
    In my case, my sidebar has room to fit and has plenty of room. I think I found an invalid div tag on my page, but it is also the extra on the theme I am using...and all those pages are fine.

    It's the <div id="wrapper"> line
    Mind taking a look?

    http://gamerways.com/members/tomcos

    Like I said...problem is only on the buddypress pages...

  13. peredur
    Member
    Posted 2 years ago #

    I'll wait for you to start a new topic, and answer you there.

    Cheers

    PAE

  14. tomcos
    Member
    Posted 2 years ago #

    Oh haha sorry, was posting at the same time as alchymth! I will start a new topic now 8)

  15. trich1
    Member
    Posted 2 years ago #

    Hi everyone! Just a flying visit for now as it's late.

    Thanks so much for your valuable feedback and help, I will follow up everyone's advice and let you know exactly what happens just as soon as I get time to implement it (preparing to move house is taking up my time at the moment! Such a drag).

    I just made one minor tweak today, which was to copy my 'Under Construction' notice into a blog post so that it turns up on the homepage as visitors didn't see it until they looked at my 'About' page. Now that the homepage has content other than the 404 error message, it is perfectly aligned!

    This leads me to think that it is a problem with the 404.php file - what do you guys think in your combined wisdom? Should I still be looking at index.php?

    Thanks for the advice! As I said, I will follow up everyone's suggestions as soon as I get a chance =)

Topic Closed

This topic has been closed to new replies.

About this Topic