Parse error: syntax error, unexpected T_CLASS (Spacious Theme)
-
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 © %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.
The topic ‘Parse error: syntax error, unexpected T_CLASS (Spacious Theme)’ is closed to new replies.