Title: Syntax Error &#8211; Unexpected T_String
Last modified: August 19, 2016

---

# Syntax Error – Unexpected T_String

 *  [gorepit](https://wordpress.org/support/users/gorepit/)
 * (@gorepit)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_string-3/)
 * Hi,
 * I was just trying to change the post excerpt length on the homepage (I don’t 
   want an excerpt, I want the whole article). I found a part of the code
 *     ```
       <?php
       function new_excerpt_length($length) {
       	return 20;
       }
       ```
   
 * and changed it to 500 to see if the word count would increase. Now I get this
   problem:
 * Parse error: syntax error, unexpected T_STRING in /home/deadandw/public_html/
   wp-content/themes/aparatus/functions.php on line 244
 * Here is my functions code:
 * Pastebin? [http://wordpress.pastebin.com/YuEnW2VV](http://wordpress.pastebin.com/YuEnW2VV)
 * How do I fix this? I tried putting the 20 value back in and refreshing but nothing
   worked. Also, if this gets fixed, how do I remove the post excerpt ?
 * My link is [http://www.Joefitzpatrick.co.uk](http://www.Joefitzpatrick.co.uk)
 * Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_string-3/#post-1779684)
 * the pastebin gives you line numbers – and this is line 244:
 *     ```
       <td width="80%"><?php if(get_option($value['id'])){ $checked = "checked="checked""; }else{ $checked = "";} ?>
       ```
   
 * i assume that this is not how it should look like:
 * `$checked = "checked="checked"";` ???
 *  Thread Starter [gorepit](https://wordpress.org/support/users/gorepit/)
 * (@gorepit)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_string-3/#post-1779694)
 * Hi
 * I’m not sure lol I haven’t touched that line at all :/
 * What should it be changed to? just “checked” ?
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_string-3/#post-1779696)
 * not sure, as i haven’t designed it – but you could try something like:
 * `<td width="80%"><?php if(get_option($value['id'])){ $checked = "checked"; }else{
   $checked = "";} ?>`
 * your edit with the ‘excerpt_length’ is a few lines after the ‘error’ line – so
   that cannot be causing it.
 *  Thread Starter [gorepit](https://wordpress.org/support/users/gorepit/)
 * (@gorepit)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_string-3/#post-1779704)
 * I get this now:
 * Parse error: syntax error, unexpected ‘”‘ in /home/deadandw/public_html/wp-content/
   themes/aparatus/functions.php on line 352
 * lol 😛
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_string-3/#post-1779706)
 * can you re-paste your functons.php ?
 *  Thread Starter [gorepit](https://wordpress.org/support/users/gorepit/)
 * (@gorepit)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_string-3/#post-1779736)
 * [http://wordpress.pastebin.com/K5gYbL6T](http://wordpress.pastebin.com/K5gYbL6T)
 * 🙂
 * Just out of interest, could I not just download the theme again and overwrite
   the functions.php file?
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_string-3/#post-1779744)
 * of course you can replace the functions.php with a fresh download –
 * btw:
    the error message comes from the uncontrolled usage of double quotes in
   strings; and if this is in the original theme, and not caused by your edits, 
   then you may get the same error messages again.
 *  Thread Starter [gorepit](https://wordpress.org/support/users/gorepit/)
 * (@gorepit)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_string-3/#post-1779799)
 * I just put the new function script in, and it’s worked 😀
 * How do I change the amount of words which are shown in the posts on the main 
   page? I think it’s something to do with post excerpt, but I want to show the 
   full article or at least 200 words of an article.
 * Thanks 🙂
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_string-3/#post-1779802)
 * changing the number in ‘new_excerpt_length’ should work;
    and there is no reason
   to assume that this should cause an error in functions.php.
 * if you want the full article on the main page, you could try and exchange ‘the_excerpt();’
   with ‘the_content();’ in the template file that generates the main page.
 * what editor are you using?
 * in the unlikely event, that the error comes back, it could be possible that your
   editor is changing some of the code, i.e. the quotation marks.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Syntax Error – Unexpected T_String’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 9 replies
 * 2 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/alchymyth/)
 * Last activity: [15 years, 5 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_string-3/#post-1779802)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
