Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2013
    Thanked 0 Times in 0 Posts

    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>'"....

  2. #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Saskatoon, Saskatchewan
    Thanked 2,668 Times in 2,637 Posts
    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?

    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 05:29 PM.

  3. Users who have thanked Fou-Lu for this post:

    hairgenius10 (02-06-2013)

  4. #3
    New Coder
    Join Date
    Mar 2010
    Thanked 3 Times in 3 Posts
    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.

  5. Users who have thanked gilgimech for this post:

    hairgenius10 (02-06-2013)


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts