• I’m developing a theme. When the file ‘functions.php’ exists on the theme folder, it creates a space on the top portion of the website just above header, breaking the entire theme. When I delete or rename ‘functions.php’, everything goes back to normal.

    I’ve checked all the margins and paddings from all the divs around this area, all the blank spaces and blank lines in the code and disabled the administration bar, but it seems that I can’t find where this is spacing is coming from.

    Here is the screenshot, with functions.php: http://i41.tinypic.com/3bkph.jpg

    Why this is happening? How do I solve this problem? How do I remove this space?

Viewing 9 replies - 1 through 9 (of 9 total)
  • You obviously have a problem in your theme’s function.php file somewhere.

    Thread Starter rafaelveiga

    (@rafaelveiga)

    Here is my function file:

    <?php
    function excerpt_ellipse($text) {
       return str_replace('[...]', '<div class="readmore"> <a href="'.get_permalink().'">Read more...</a></div>', $text); }
    add_filter('the_excerpt', 'excerpt_ellipse');
    ?>

    And that’s it.

    It’s just a script to replace the […] from the excerpt with a Read More link

    And what happens if you have a completely blank functions.php file?

    Thread Starter rafaelveiga

    (@rafaelveiga)

    The space still remains

    Try creating a new blank functions.php file.

    Thread Starter rafaelveiga

    (@rafaelveiga)

    It doesn’t change anything, the space still remains when there is a functions.php (blank) file in the folder

    What are you using to create this blank functions,php file?

    Thread Starter rafaelveiga

    (@rafaelveiga)

    I was using Adobe Dreamweaver CS4. I’ve created another totally blank functions.php file via notepad and the problem apparently is solved.

    I’ve already re-inserted my code on my new functions.php file and it’s now working, the space is gone.

    Can you tell me what was going on with Dreamweaver? Why there is that space when the file is created via Dreamweaver?

    Thanks for the help!

    Sounds like Dreamweaver is inserting invisible characters at the top of the file.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Functions.php adding weird top space on theme’ is closed to new replies.