Title: Functions.php adding weird top space on theme
Last modified: August 20, 2016

---

# Functions.php adding weird top space on theme

 *  [rafaelveiga](https://wordpress.org/support/users/rafaelveiga/)
 * (@rafaelveiga)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/functionsphp-adding-weird-top-space-on-theme/)
 * 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](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)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/functionsphp-adding-weird-top-space-on-theme/#post-2633159)
 * You obviously have a problem in your theme’s function.php file somewhere.
 *  Thread Starter [rafaelveiga](https://wordpress.org/support/users/rafaelveiga/)
 * (@rafaelveiga)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/functionsphp-adding-weird-top-space-on-theme/#post-2633160)
 * 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
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/functionsphp-adding-weird-top-space-on-theme/#post-2633166)
 * And what happens if you have a completely blank functions.php file?
 *  Thread Starter [rafaelveiga](https://wordpress.org/support/users/rafaelveiga/)
 * (@rafaelveiga)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/functionsphp-adding-weird-top-space-on-theme/#post-2633169)
 * The space still remains
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/functionsphp-adding-weird-top-space-on-theme/#post-2633188)
 * Try creating a new blank functions.php file.
 *  Thread Starter [rafaelveiga](https://wordpress.org/support/users/rafaelveiga/)
 * (@rafaelveiga)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/functionsphp-adding-weird-top-space-on-theme/#post-2633196)
 * It doesn’t change anything, the space still remains when there is a functions.
   php (blank) file in the folder
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/functionsphp-adding-weird-top-space-on-theme/#post-2633198)
 * What are you using to create this blank functions,php file?
 *  Thread Starter [rafaelveiga](https://wordpress.org/support/users/rafaelveiga/)
 * (@rafaelveiga)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/functionsphp-adding-weird-top-space-on-theme/#post-2633205)
 * 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!
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/functionsphp-adding-weird-top-space-on-theme/#post-2633392)
 * 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.

## Tags

 * [functions](https://wordpress.org/support/topic-tag/functions/)
 * [header](https://wordpress.org/support/topic-tag/header/)
 * [margin](https://wordpress.org/support/topic-tag/margin/)
 * [padding](https://wordpress.org/support/topic-tag/padding/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [problem](https://wordpress.org/support/topic-tag/problem/)
 * [spacing](https://wordpress.org/support/topic-tag/spacing/)
 * [top](https://wordpress.org/support/topic-tag/top/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 9 replies
 * 2 participants
 * Last reply from: [esmi](https://wordpress.org/support/users/esmi/)
 * Last activity: [14 years, 2 months ago](https://wordpress.org/support/topic/functionsphp-adding-weird-top-space-on-theme/#post-2633392)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
