• Using WordPress Spacious Theme:

    First of all, I copied the entire contents of the original Theme Functions (inc/funtions.php) to my notepad and saved it as a backup.

    I then tried to edit the copyright section to customize it for my needs. After I clicked “Update file” I got the following error:

    Parse error: syntax error, unexpected T_CLASS in /home/tmbtxusv/public_html/wp-content/themes/spacious/inc/functions.php on line 466

    I looked at line 466 and could not anything wrong with it when I compared it to the original text. Here is line 466:

    $tg_link = '<a href="'.esc_url( 'http://themegrill.com/themes/spacious' ).'" target="_blank" title="'.esc_attr__( 'ThemeGrill', 'spacious' ).'" rel="designer"><span>'.__( 'ThemeGrill', 'spacious') .'</span></a>';

    So in order to get back to a good working state, I highlighted all of the text in the Theme Functions (inc/functions.php) area and deleted it. Then I used the backup I made and copied that text back into the Theme Functions (inc/functions.php) area and the same error still exists!? How can that be?

    Here is the original text inside the Theme Functions (inc/functions.php) area with the section surrounding line 466:

    add_action( 'spacious_footer_copyright', 'spacious_footer_copyright', 10 );
    /**
     * function to show the footer info, copyright information
     */
    if ( ! function_exists( 'spacious_footer_copyright' ) ) :
    function spacious_footer_copyright() {
        $site_link = '<a href="' . esc_url( home_url( '/' ) ) . '" title="' . esc_attr( get_bloginfo( 'name', 'display' ) ) . '" ><span>' . get_bloginfo( 'name', 'display' ) . '</span></a>';
    
        $wp_link = '<a href="'.esc_url( 'http://ww.wp.xz.cn' ).'" target="_blank" title="' . esc_attr__( 'WordPress', 'spacious' ) . '"><span>' . __( 'WordPress', 'spacious' ) . '</span></a>';
    
        $tg_link =  '<a href="'.esc_url( 'http://themegrill.com/themes/spacious' ).'" target="_blank" title="'.esc_attr__( 'ThemeGrill', 'spacious' ).'" rel="designer"><span>'.__( 'ThemeGrill', 'spacious') .'</span></a>';
    
        $default_footer_value = sprintf( __( 'Copyright &copy; %1$s %2$s.', 'spacious' ), date( 'Y' ), $site_link ).' '.sprintf( __( 'Powered by %s.', 'spacious' ), $wp_link ).' '.sprintf( __( 'Theme: %1$s by %2$s.', 'spacious' ), 'Spacious', $tg_link );
    
        $spacious_footer_copyright = '<div class="copyright">'.$default_footer_value.'</div>';
        echo $spacious_footer_copyright;
    }
    endif;

    Does anyone know what the problem is? It shouldn’t be this difficult.

Viewing 1 replies (of 1 total)
  • Moderator t-p

    (@t-p)

    I then tried to edit the copyright section to customize it for my needs. After I clicked “Update file” I got the following error:

    – I take your theme was working before changes you made.

    you may try:

    – uploading an unedited copy of the file(s) in question from a fresh download of your theme.

    – If that does not help, upload the entire theme from a fresh download.

    – if you need immediate access to your dashboard, try switching to the unedited default Twenty Fifteen theme. If you don’t have access to your admin area, use FTP , or your web-host’s cPanel or whatever file management application your host provides. Navigate to /wp-content/themes/ and switch to the default theme by renaming your current theme’s folder by adding “-old” to the end of the folder name. Alternately, you can remove other themes except the default theme. That will force your site to use it.

Viewing 1 replies (of 1 total)

The topic ‘Parse error: syntax error, unexpected T_CLASS (Spacious Theme)’ is closed to new replies.