WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Parse error: syntax error, unexpected ' (6 posts)

  1. politicalolelady@gmail.com
    Member
    Posted 1 year ago #

    Hi,

    Using Hybrid and the child theme Structure. Getting a parse error on line 52 and I can't seem to find it. Need a fresh set of eyes to take a look.

    Thanks in advance. Code is below.

    <?php
    
    /**
    * This is your child theme's functions.php file.
    * You should make edits and add additional code above this point.
    * Only change the functions below if you know what you're doing.
    */
    
    /********************************************************/
    
    /* Localization. */
    load_child_theme_textdomain( 'structure', get_stylesheet_directory() . '/languages' );
    
    /* Actions. */
    add_action( 'hybrid_after_primary_menu', 'get_search_form' );
    add_action( 'widgets_init', 'structure_register_sidebars' );
    add_action( 'hybrid_header', 'structure_get_utility_header' );
    
    /* Filters. */
    add_filter( 'breadcrumb_trail', 'structure_disable' );
    
    /**
     * Register additional widget areas for the theme.
     *
     * @since 2.1
     * @uses register_sidebar() Registers a new widget area.
     */
    function structure_register_sidebars() {
    	register_sidebar( array( 'name' => __( 'Utility: Header', 'structure' ), 'id' => 'utility-header', 'before_widget' => '<div id="%1$s" class="widget %2$s widget-%2$s"><div class="widget-inside">', 'after_widget' => '</div></div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>' ) );
    }
    
    /**
     * Checks if the Utility: Header widget area is active.  If it is, it is
     * then wrapped with an appropriate element and displayed.
     *
     * @since 2.0
     * @uses get_sidebar() Locates the sidebar template.
     */
    function structure_get_utility_header() {
    	get_sidebar( 'header' );
    }
    
    /**
     * Filter function for disabling variables. It returns false for everything.
     *
     * @since 2.0
     */
    function structure_disable( $var ) {
    	return false;
    }
    
    ?>

    [Moderator Note: Please post code or markup snippets between backticks or use the code button. Or better still - use the pastebin. As it stands, your code may now have been permanently damaged/corrupted by the forum's parser.]

  2. pwhstacy
    Member
    Posted 1 year ago #

    Hello,

    make sure you didn't add extra space before <?php and after ?>

    make sure you didn't forget single quote in your define() ..
    make sure all define() are ended with ;

  3. Andrew
    Forum Moderator
    Posted 1 year ago #

    Which line is 52 and what is the entire error message?

  4. politicalolelady@gmail.com
    Member
    Posted 1 year ago #

    @Andrew

    Entire error message:

    Parse error: syntax error, unexpected '<' in /home/mkyd1963/public_html/politicalolelady.com/wp-content/themes/structure/functions.php on line 52

    @pwhstacy

    Checking that now

  5. esmi
    Forum Moderator
    Posted 1 year ago #

    Try switching to the Twenty Eleven theme by renaming:

    wp-content/themes/structure

    to:

    wp-content/themes/structure-old

    using FTP or whatever file management application your host provides.

  6. politicalolelady@gmail.com
    Member
    Posted 1 year ago #

    Fixed. Took a look at it from cpanel and found the '<'. Didn't show up in WP Editor for some reason. But thanks for the tip, esmi, I'll keep that in mind. Appreciate Andrew and pwhstacy's input too. Made me think outside the box..Thanks again

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.