Title: functions.php mess
Last modified: August 19, 2016

---

# functions.php mess

 *  [tbanucci](https://wordpress.org/support/users/tbanucci/)
 * (@tbanucci)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/functionsphp-mess/)
 * I have two blogs, one of which I had a customized theme made for (call this A).
   I recently created my second blog (B) and wanted to copy the exact theme from
   A to B and then modify it.
 * Easy, just copy over the theme folder, right? Wrong. Everything copies over fine,
   but if I copy over the functions.php page, anywhere I click in WordPress Admin,
   I get this error (modified a bit to make it easier to read):
 * Fatal error: Cannot redeclare site_url() (previously declared in /wp-includes/
   link-template.php:788) in /wp-content/themes/dapit_hapon/functions.php on line
   2
 * My functions.php file looks like this:
 *     ```
       <?php
       function site_url() {
         $url = "http://www.mydomain.com/"; // ENTER URL WITH TRAILING SLASH (/)
         echo $url;
       }
       ?>
       <?php
       $url = "http://www.mydomain.com/"; // ENTER URL WITH TRAILING SLASH (/)
       if ( function_exists('register_sidebar') )
           register_sidebar(array(
               'before_widget' => '',
               'after_widget' => '<div class="line_hor"><img alt="" src="' . $url . 'images/spacer.gif" width="1" height="3" /></div>',
               'before_title' => '<span class="txt1">',
               'after_title' => '</span><br /><br />',
           ));
       ?>
       ```
   
 * mydomain.com was thrown in there to protect the innocent! 🙂
 * I’m not really sure why I can’t just copy this theme from one blog to the next.
   Can anyone lend some advice? Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [cutomthemedesign](https://wordpress.org/support/users/cutomthemedesign/)
 * (@cutomthemedesign)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/functionsphp-mess/#post-885308)
 * It seems to me as you can’t re-declare a preserved function in link-template.
   php already declare. so the problem got to be with function name site_url()
 *  Thread Starter [tbanucci](https://wordpress.org/support/users/tbanucci/)
 * (@tbanucci)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/functionsphp-mess/#post-885417)
 * I think that’s the problem too, but it’s working fine on my other blog: [http://www.lastcuthomes.com/news/](http://www.lastcuthomes.com/news/)
 * If I don’t have “function name site_url()” then should I erase that line or how
   do I fix it?
 *  Thread Starter [tbanucci](https://wordpress.org/support/users/tbanucci/)
 * (@tbanucci)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/functionsphp-mess/#post-885464)
 * I have located the problem, but I still don’t know how to fix it, maybe someone
   here does.
 * My new blog is running on 2.6.2 while the other blog with the original theme 
   is on 2.6.0. I tried yesterday upgrading my other blog yesterday and found that
   the functions.php file screwed the whole blog, making it unable to run (with 
   a similar error code). Once I removed the functions.php file, the blog displayed,
   but without much of the CSS it should. What I did was restore from a backup back
   down to 2.6.0 and everything worked properly again.
 * So what this means to me is that there were some code changes in WordPress that
   conflict with my functions.php file. Since I’m a programming newb, maybe someone
   else in here knows what code in that functions.php file is bad? Or do functions.
   php scripts not even work anymore? Should I code it’s functionality somewhere
   else into my site?
 * Any help would be appreciated!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘functions.php mess’ is closed to new replies.

 * 3 replies
 * 2 participants
 * Last reply from: [tbanucci](https://wordpress.org/support/users/tbanucci/)
 * Last activity: [17 years, 7 months ago](https://wordpress.org/support/topic/functionsphp-mess/#post-885464)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
