WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Error in functions.php. Please help!! (10 posts)

  1. spandabel
    Member
    Posted 2 years ago #

    Hi!

    Suddenly I got the message:

    Parse error: syntax error, unexpected T_CLASS in /home/spandabe/public_html/wp-content/themes/modularity-lite/functions.php on line 72

    when opening my site http://www.spandabel.dk

    I only changed things in header.php, not in functions.php!

    This is how it looks in my functions.php around line 72:

    // The header business begins here:
    
    // No CSS, just IMG call
    define('HEADER_TEXTCOLOR', '');
    define('HEADER_IMAGE', '');
    define('HEADER_IMAGE_WIDTH', 950);
    define('HEADER_IMAGE_HEIGHT', 250);
    define( 'NO_HEADER_TEXT', true );
    
    function modularity_admin_header_style() {
    ?>
    <style type="text/css">
    #headimg {
    	height: <?php echo HEADER_IMAGE_HEIGHT; ?>px;
    	width: <?php echo HEADER_IMAGE_WIDTH; ?>px;
    }

    Does anybody have an idea what has happened??
    Thanks.
    - Anne

    btw - the theme I'm using is Modularity Lite

  2. Ross Hanney
    Member
    Posted 2 years ago #

    Hello,

    Could you post all the code from your functions.php and header.php files? (Use pastebin, or similar).

    Ross

  3. spandabel
    Member
    Posted 2 years ago #

    Thanks for responding.
    I've never used pastebin, but here's a link to the functions.php
    http://pastebin.com/t167ju6M

    I cannot get to the header.php. In fact I'm "locked" in the functions.php, everytime I update I get the error, and the only thing I can do then is to go back in my browser to the functions.php

  4. Abdul Awal Uzzal
    Member
    Posted 2 years ago #

    Hello,
    You may access to your header.php using ftp & modify the file .

  5. Ross Hanney
    Member
    Posted 2 years ago #

    There doesn't appear to an error in that code.

    As Abdul suggests, you should be able to access the functions.php and header.php files via FTP, or by using the file manager in your hosting control panel.

  6. spandabel
    Member
    Posted 2 years ago #

    So I managed to find my header.php using filezilla.
    here it is:

    http://pastebin.com/KsqbD6UM

  7. Ross Hanney
    Member
    Posted 2 years ago #

    Could you post the code from functions.php accessed via FileZilla?

  8. spandabel
    Member
    Posted 2 years ago #

    Sure! Here it is:

    http://pastebin.com/wDbHtU5f

  9. Ross Hanney
    Member
    Posted 2 years ago #

    There are several errors in the include_search_box function in your functions.php file. That function should probably be as follows:

    function include_search_box( $items, $args ) {
    	// only display search box on our primary menu
    	if( 'primary' === $args->theme_location )
    		$items .= '<li class="menu-item menu-item-search">' . get_search_form( false ) . '</li>';
    
    	return $items;
    }
    
    add_filter( 'wp_nav_menu_items', 'include_search_box', 10, 2 );
  10. spandabel
    Member
    Posted 2 years ago #

    You just made my day!!! That search-box wasn't even supposed to be there - or anywhere.
    Thank you so much for your guidance and help!

Topic Closed

This topic has been closed to new replies.

About this Topic