Community Forums › Forums › Archived Forums › General Discussion › Fatal error: Cannot redeclare theme_setup() (previously declared in…
- This topic has 4 replies, 2 voices, and was last updated 7 years, 4 months ago by JA Armira.
-
AuthorPosts
-
August 31, 2017 at 1:13 pm #210991JA ArmiraMember
Two days ago updated to WP 4.8.1, at first got an error that WP couldn't be updated, tried again and it seem to work. But soon after i got these errors: (Not on that order)
Warning: An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in /Users/MyMac/Sites/MYSite/wp-includes/update.php on line 501
Warning: Cannot modify header information - headers already sent by (output started at /Users/MyMac/Sites/GDWP/wp-includes/update.php:501) in /Users/MyMac/Sites/MySite/wp-includes/pluggable.php on line 1210
Fatal error: Cannot redeclare gd_web_pros_setup() (previously declared in /Users/MyMac/Sites/MySite/wp-content/themes/Mytheme/functions.php:49
This is only happening on my main child theme, if i rename that theme everything work fine
I am using genesis child theme sample on iMac Sierra and MAMP localhost
http://loclahost
Thank you for your help!September 1, 2017 at 12:36 am #211008Brad DaltonParticipantLooks like you copied a function on line 49 of functions. You must use unique function names so change it and the 2nd parameter for add_action
September 1, 2017 at 9:37 am #211019JA ArmiraMemberThank you for the response, braddalto!
Since i posted, i have been trying to find a solution, and i understand there is a duplicate function, but i can't see where or how it is duplicated.
Here is the code that is referenced( now on different lines: 68 and 75) ://* Enqueue Scripts add_action( 'wp_enqueue_scripts', 'gdpros_load_scripts' ); function gdpros_load_scripts() { //* Line 68 wp_enqueue_script( 'gdpros-responsive-menu', get_bloginfo( 'stylesheet_directory' ) . '/js/responsive-menu.js', array( 'jquery' ), '1.0.0' ); wp_enqueue_style( 'dashicons' ); wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Open+Sans:400,600,300,800,700,400italic|PT+Serif:400,400italic', array(), '1.0.0' ); wp_enqueue_style('google-fonts','//fonts.googleapis.com/css?family=Gruppo|Josefin+Sans:400,300italic,300,100,100italic|Josefin+Slab:100,100italic,300,300italic,400,600|Poiret+One|Quicksand:400,300,700', array(), '1.0.0'); } //* Line 75 //* Enqueue Backstretch script and prepare images for loading add_action( 'wp_enqueue_scripts', 'gdpros_enqueue_backstretch_scripts' ); function gdpros_enqueue_backstretch_scripts() { $image = get_option( 'gdpros-backstretch-image', sprintf( '%s/images/freelance-wordpress-developer.jpg', get_stylesheet_directory_uri() ) ); //* Load scripts only if custom backstretch image is being used if ( ! empty( $image ) ) { wp_enqueue_script( 'gdpros-backstretch', get_bloginfo( 'stylesheet_directory' ) . '/js/backstretch.js', array( 'jquery' ), '1.0.0' ); wp_enqueue_script( 'gdpros-backstretch-set', get_bloginfo( 'stylesheet_directory' ).'/js/backstretch-set.js' , array( 'jquery', 'gdpros-backstretch' ), '1.0.0' ); wp_localize_script( 'gdpros-backstretch-set', 'BackStretchImg', array( 'src' => str_replace( 'http:', '', $image ) ) ); } }
Any help appreciated!! It looks like i duplicated the post, sorry about that!
September 1, 2017 at 9:37 am #211020JA ArmiraMemberThank you for the response, braddalto!
Since i posted, i have been trying to find a solution, and i understand there is a duplicate function, but i can't see where or how it is duplicated.
Here is the code that is referenced( now on different lines: 68 and 75) ://* Line 68 wp_enqueue_script( 'gdpros-responsive-menu', get_bloginfo( 'stylesheet_directory' ) . '/js/responsive-menu.js', array( 'jquery' ), '1.0.0' ); wp_enqueue_style( 'dashicons' ); wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Open+Sans:400,600,300,800,700,400italic|PT+Serif:400,400italic', array(), '1.0.0' ); wp_enqueue_style('google-fonts','//fonts.googleapis.com/css?family=Gruppo|Josefin+Sans:400,300italic,300,100,100italic|Josefin+Slab:100,100italic,300,300italic,400,600|Poiret+One|Quicksand:400,300,700', array(), '1.0.0'); } //* Line 75 //* Enqueue Backstretch script and prepare images for loading add_action( 'wp_enqueue_scripts', 'gdpros_enqueue_backstretch_scripts' ); function gdpros_enqueue_backstretch_scripts() { $image = get_option( 'gdpros-backstretch-image', sprintf( '%s/images/freelance-wordpress-developer.jpg', get_stylesheet_directory_uri() ) ); //* Load scripts only if custom backstretch image is being used if ( ! empty( $image ) ) { wp_enqueue_script( 'gdpros-backstretch', get_bloginfo( 'stylesheet_directory' ) . '/js/backstretch.js', array( 'jquery' ), '1.0.0' ); wp_enqueue_script( 'gdpros-backstretch-set', get_bloginfo( 'stylesheet_directory' ).'/js/backstretch-set.js' , array( 'jquery', 'gdpros-backstretch' ), '1.0.0' ); wp_localize_script( 'gdpros-backstretch-set', 'BackStretchImg', array( 'src' => str_replace( 'http:', '', $image ) ) ); } }
Any help appreciated!!
September 1, 2017 at 9:39 am #211021JA ArmiraMemberThank you for the response, braddalto!
Since i posted, i have been trying to find a solution, and i understand there is a duplicate function, but i can't see where or how it is duplicated.
Here is the code that is referenced( now on different lines: 68 and 75) ://* Enqueue Scripts add_action( 'wp_enqueue_scripts', 'gdpros_load_scripts' ); function gdpros_load_scripts() { //* Line 68 wp_enqueue_script( 'gdpros-responsive-menu', get_bloginfo( 'stylesheet_directory' ) . '/js/responsive-menu.js', array( 'jquery' ), '1.0.0' ); wp_enqueue_style( 'dashicons' ); wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Open+Sans:400,600,300,800,700,400italic|PT+Serif:400,400italic', array(), '1.0.0' ); wp_enqueue_style('google-fonts','//fonts.googleapis.com/css?family=Gruppo|Josefin+Sans:400,300italic,300,100,100italic|Josefin+Slab:100,100italic,300,300italic,400,600|Poiret+One|Quicksand:400,300,700', array(), '1.0.0'); } //* Line 75 //* Enqueue Backstretch script and prepare images for loading add_action( 'wp_enqueue_scripts', 'gdpros_enqueue_backstretch_scripts' ); function gdpros_enqueue_backstretch_scripts() { $image = get_option( 'gdpros-backstretch-image', sprintf( '%s/images/freelance-wordpress-developer.jpg', get_stylesheet_directory_uri() ) ); //* Load scripts only if custom backstretch image is being used if ( ! empty( $image ) ) { wp_enqueue_script( 'gdpros-backstretch', get_bloginfo( 'stylesheet_directory' ) . '/js/backstretch.js', array( 'jquery' ), '1.0.0' ); wp_enqueue_script( 'gdpros-backstretch-set', get_bloginfo( 'stylesheet_directory' ).'/js/backstretch-set.js' , array( 'jquery', 'gdpros-backstretch' ), '1.0.0' ); wp_localize_script( 'gdpros-backstretch-set', 'BackStretchImg', array( 'src' => str_replace( 'http:', '', $image ) ) ); } }
Any help appreciated!!
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.