• navienavnav

    (@navienavnav)


    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 :
    https://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

Viewing 14 replies - 1 through 14 (of 14 total)
  • Moderator keesiemeijer

    (@keesiemeijer)

    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.

    Thread Starter navienavnav

    (@navienavnav)

    The page in question is this :

    https://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.

    Moderator keesiemeijer

    (@keesiemeijer)

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

    Thread Starter navienavnav

    (@navienavnav)

    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?

    Moderator keesiemeijer

    (@keesiemeijer)

    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.

    Thread Starter navienavnav

    (@navienavnav)

    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 =>
    https://pastebin.com/E4PX4ryg

    header.php =>

    https://pastebin.com/fX3RCN22

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

    Thanks.

    Moderator keesiemeijer

    (@keesiemeijer)

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

    can you put header.html also in a pastebin

    Thread Starter navienavnav

    (@navienavnav)

    Here’s the content of header.html :

    https://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.

    Moderator keesiemeijer

    (@keesiemeijer)

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

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

    esmi

    (@esmi)

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

    Moderator keesiemeijer

    (@keesiemeijer)

    sorry, use this as index.php

    Moderator keesiemeijer

    (@keesiemeijer)

    sorry again, this is the right index.php

    Thread Starter navienavnav

    (@navienavnav)

    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.

    Moderator keesiemeijer

    (@keesiemeijer)

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

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘White space above custom header in theme, no solution working! Please please hel’ is closed to new replies.