functions.php 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 = "https://www.mydomain.com/"; // ENTER URL WITH TRAILING SLASH (/) echo $url; } ?> <?php $url = "https://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!
- The topic ‘functions.php mess’ is closed to new replies.