Forums

White space above custom header in theme, no solution working! Please please hel (15 posts)

  1. navienavnav
    Member
    Posted 8 months ago #

    Alright so I have this weird whitespace above the header which I have included by,

    <?php include("header.html") ?>

    where header.html is an html file that I use all over my site as a consistent header (so that i don't have to change navigation bar on every page if I happen to edit it.)

    This is how the site is looking though :
    http://amritkhare.co.cc/un.jpg

    The black arrow points to the problem in the above picture.

    I googled the problem and came up with various solution which more or less told about modifying padding/margin values in style.css
    but none of the solutions have worked so far.

    I even tried putting the php code of inclusion at various points in both header.php and index.php in the theme folder but to no avail. The white space stays there exactly the same way.

    Note that this problem persists irrespective of the fact whether I am logged in or logged out of the WordPress control panel as someone suggested on some forum that that might be the problem.

    I am running out of option and this is driving me crazy. I hope someone can help me and the one who can will meet the most beautiful/handsome guy/girl (as applicable) he she ever wanted ! LOL

  2. keesiemeijer
    moderator
    Posted 8 months ago #

    Without the ability to look at the page in question (under construction) no one will be able to offer much in the way of assistance.

  3. navienavnav
    Member
    Posted 8 months ago #

    The page in question is this :

    http://amritkhare.co.cc/blog/

    Content of header.php :

    [413 lines of code moderated as per the Forum Rules. Please use the pastebin]

    I have basically modified another theme to get the desired result so there might be redundant code in the above files. Sorry about that and many thanks.

  4. keesiemeijer
    moderator
    Posted 8 months ago #

    There is html above the doctype with four empty paragraphs that is causing this whitespace. validate your website

  5. navienavnav
    Member
    Posted 8 months ago #

    Thanks for your quick reply.

    What I don't get is where this extra code above the DOCTYPE is coming from. In the theme, in index.php, there is no such code but it starts from the first doctype itself. Then, where is this four paragraph code above the doctype coming from? Maybe I am missing something? Like some other file adding those codes? Can you give me any hint as to what it can possibly be?

  6. keesiemeijer
    moderator
    Posted 8 months ago #

    You should have the doctype in your header.php and only in your header.php. I think you also include a header.html (also with a doctype). In total you have 3 doctype in the source code. Can you please post the header.php and the index.php in a pastebin as per the forum rules.

  7. navienavnav
    Member
    Posted 8 months ago #

    I have removed the doctypes in index.php and the header.html file as you mentioned. I don't exactly know how to use this pastebin thing but I am including what I think I am required to include below :

    index.php =>
    http://pastebin.com/E4PX4ryg

    header.php =>

    http://pastebin.com/fX3RCN22

    I don't understand where the code causing the problem is coming from?

    Thanks.

  8. keesiemeijer
    moderator
    Posted 8 months ago #

    Try it with this index.php
    and this header.php

    can you put header.html also in a pastebin

  9. navienavnav
    Member
    Posted 8 months ago #

    Here's the content of header.html :

    http://pastebin.com/49S29sYt

    I replaced my header.php and index.php with what you provided in the last post but the problem remains.

    Thank you so much for your time. I really am grateful!
    Awaiting your response.

    P.S. I have the same link for every item of the navigation list just for testing purposes. Just in case you were wondering.

  10. keesiemeijer
    moderator
    Posted 8 months ago #

    Not sure if this is going to work but here goes:

    use this as header.php
    and this as index.php

  11. esmi
    Theme Diva & Forum Moderator
    Posted 8 months ago #

    You also have 2 leading blank lines in your header.html file

  12. keesiemeijer
    moderator
    Posted 8 months ago #

    sorry, use this as index.php

  13. keesiemeijer
    moderator
    Posted 8 months ago #

    sorry again, this is the right index.php

  14. navienavnav
    Member
    Posted 7 months ago #

    Nope. Not working. And it seems there is no link to the CSS file anymore either but that's not the problem. The thing is when I am viewing the source code of the final page as viewed on firefox, the troublesome code (at the top) is still right there so regardless of all the changes, the white space is still there.

    I think I am going to start from scratch and build up the theme; completely neat and validating at every step. I was just trying to make a short-cut by editing another theme and just "make it work". The whole code has more than 30 validation errors anyway.

    I really thank you keesiemeijer for your precious time and input. If in the future I have a problem, I'll be sure to reach you. :)

    Thanks again.

  15. keesiemeijer
    moderator
    Posted 7 months ago #

    You're welcome and that is probably the best solution, good luck.

Reply

You must log in to post.

About this Topic