Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-15-2013, 01:01 PM   PM User | #1
hairgenius10
New to the CF scene

 
Join Date: Jan 2013
Location: Virginia
Posts: 1
Thanks: 2
Thanked 0 Times in 0 Posts
hairgenius10 is an unknown quantity at this point
Arrow Unexpected "T_ECHO"...Please Help!

I got this on my homepage unexpectedly...

Fatal error: Call to undefined function dynamic_sidebar() in /home/content/36/8575136/html/wp-content/themes/mosaic/functions.php on line 459


Then tried to tweak the code myself and got this...

Parse error: syntax error, unexpected T_ECHO, expecting ')' in /home/content/36/8575136/html/wp-content/themes/mosaic/functions.php on line 460

I even changed it back and it's still messed up! I don't know what to do and it may have been because of a plugin update, I'm not sure. Can anyone help me....my site doesn't work!


Here is a snippet of the code that is needing to be fixed....

add_action('mosaic_header','mosaic_logo', 2);


// Hookable theme option field to add add'l content to header
// Child Theme Override: child_header_extras();
function mosaic_header_extras() {
echo '<div id="header-extras">';
dynamic_sidebar( 'header-widget-area' );
echo '</div>';
}
add_action('mosaic_header','mosaic_header_extras', 3);




**Lines 450 and 460 are the "dynamic_sidebar...." and "echo '</div>'"....
hairgenius10 is offline   Reply With Quote
Old 01-15-2013, 04:27 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,645
Thanks: 4
Thanked 2,449 Times in 2,418 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Not sure why this is in general web building, this is a PHP error.
This code passes a lint test (as well as visual :P). Your problem is elsewhere. Is this code from functions.php?

Edit:
Oh wait you were changing things so there are two possible errors.
The first one is clear, there is no function called dynamic_sidebar in scope to work with. Maybe your missing an include?
The second one could be caused by having an open string prior to the error. We can't verify that since you don't have enough code.

Last edited by Fou-Lu; 01-15-2013 at 04:29 PM..
Fou-Lu is offline   Reply With Quote
Users who have thanked Fou-Lu for this post:
hairgenius10 (02-06-2013)
Old 01-16-2013, 12:38 AM   PM User | #3
gilgimech
New Coder

 
Join Date: Mar 2010
Posts: 58
Thanks: 10
Thanked 3 Times in 3 Posts
gilgimech is an unknown quantity at this point
The dynamic_sidebar() function is part of the WordPress Core. There should be no reason you're getting an error for it.

Where you editing any of the core files (anything not in the theme directory)?

If you don't find any errors in your functions.php file that would explain it I would suggest doing a fresh install of WordPress. If your still getting any errors then get a fresh copy of the mosaic theme.
gilgimech is offline   Reply With Quote
Users who have thanked gilgimech for this post:
hairgenius10 (02-06-2013)
Reply

Bookmarks

Tags
code, functions, php, theme editor

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:38 AM.


Advertisement
Log in to turn off these ads.