Title: &quot;Parse Error  syntax error, unexpected T_IF&#8230;&quot; for PHP newbie
Last modified: August 20, 2016

---

# "Parse Error syntax error, unexpected T_IF…" for PHP newbie

 *  Resolved [Iplish](https://wordpress.org/support/users/iplish/)
 * (@iplish)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_if-for-php-newbie/)
 * Hi Guys,
 * I was just copying and pasting some code into my custom_functions.php, and went
   to delete exactly what I had just pasted in. I must have accidentally deleted
   a character somewhere, because now I get the above syntax error. I know absolutely
   nothing about php, can anyone point out what’s wrong? Here is the code, supposedly
   the error is on on line 26. I am using Thesis.
 *     ```
       <?php
   
       // Using hooks is absolutely the smartest, most bulletproof way to implement things like plugins,
       // custom design elements, and ads. You can add your hook calls below, and they should take the
       // following form:
       // add_action('thesis_hook_name', 'function_name');
       // The function you name above will run at the location of the specified hook. The example
       // hook below demonstrates how you can insert Thesis' default recent posts widget above
       // the content in Sidebar 1:
       // add_action('thesis_hook_before_sidebar_1', 'thesis_widget_recent_posts');
       // this is how to remove the comments hook
   
       remove_action('thesis_hook_after_post','thesis_comments_link');
   
       function full_width_nav() { ?>
       	<div id="nav_area" class="full_width">
       		<div class="page">
       			<?php thesis_nav_menu(); ?>
       		</div>
       	</div>
       <?php }
   
       remove_action('thesis_hook_before_header', 'thesis_nav_menu');
       add_action('thesis_hook_before_content_area', 'full_width_nav')
   
       function custom_bookmark_links() {
       	global $post;
       ?>
       <ul class="bookmark_links">
       	<li><a rel="nofollow" href="http://delicious.com/save?url=<?php urlencode(the_permalink()); ?>&title=<?php urlencode(the_title()); ?>" onclick="window.open('http://delicious.com/save?v=5&noui&jump=close&url=<?php urlencode(the_permalink()); ?>&title=<?php urlencode(the_title()); ?>', 'delicious', 'toolbar=no,width=550,height=550'); return false;" title="Bookmark this post on del.icio.us">Bookmark this article on Delicious</a></li>
       </ul>
       <?php }
   
       /**
        * function custom_bookmark_links() - outputs an HTML list of bookmarking links
        * NOTE: This only works when called from inside the WordPress loop!
        * SECOND NOTE: This is really just a sample function to show you how to use custom functions!
        *
        * @since 1.0
        * @global object $post
       */
       ```
   

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

 *  Moderator [t-p](https://wordpress.org/support/users/t-p/)
 * (@t-p)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_if-for-php-newbie/#post-2917809)
 * try replacing your functions.php with a fresh copy
 *  Thread Starter [Iplish](https://wordpress.org/support/users/iplish/)
 * (@iplish)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_if-for-php-newbie/#post-2917844)
 * I tried replacing the functions.php with a fresh copy. Same error. The line the
   error is supposedly on, 26, also stays the same even if I start moving code around.
   I tried replacing my customs_functions.php with a fresh copy, thinking I’d just
   start over with all my custom functions, and it still gave me the error. Not 
   sure what to do.
 *  [Pioneer Web Design](https://wordpress.org/support/users/swansonphotos/)
 * (@swansonphotos)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_if-for-php-newbie/#post-2917849)
 * In above remove the two lines:
 *     ```
       <?php }
       ```
   
 * The line:
 *     ```
       ?>
       ```
   
 * The lines:
 *     ```
       /**
        * function custom_bookmark_links() - outputs an HTML list of bookmarking links
        * NOTE: This only works when called from inside the WordPress loop!
        * SECOND NOTE: This is really just a sample function to show you how to use custom functions!
        *
        * @since 1.0
        * @global object $post
       */
       ```
   
 * and put this as the last line:
 *     ```
       ?>
       ```
   
 *  [Pioneer Web Design](https://wordpress.org/support/users/swansonphotos/)
 * (@swansonphotos)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_if-for-php-newbie/#post-2917850)
 * One more error(s)…
 *     ```
       function full_width_nav() { ?>
       ```
   
 * should be
 *     ```
       function full_width_nav() {
       ```
   
 * and the function ends with }
 *  Thread Starter [Iplish](https://wordpress.org/support/users/iplish/)
 * (@iplish)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_if-for-php-newbie/#post-2917864)
 * worked, thanks!
 *  Moderator [t-p](https://wordpress.org/support/users/t-p/)
 * (@t-p)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_if-for-php-newbie/#post-2917919)
 * you are welcome. 🙂
 *  [rabsal](https://wordpress.org/support/users/rabsal/)
 * (@rabsal)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_if-for-php-newbie/#post-2917947)
 * This is, what I get when installing.
    The file is wp-config.php. I edited the
   wp-config-sample.php as directed. Inserted database details and copied the keys.
   I used the editor of Windows. But cannot identify the line 45 mentioned. Editor
   does not give line numbers. How can I go on from here? Thanks for any suggestion!
 * MacBook Pro, Mac OS X, WordPress 3.4.1,
 * Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /homepages/
   15/d246579546/htdocs/georgeshomepage/wp-config.php on line 45

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

The topic ‘"Parse Error syntax error, unexpected T_IF…" for PHP newbie’ is closed
to new replies.

## Tags

 * [parse-error](https://wordpress.org/support/topic-tag/parse-error/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [syntax error](https://wordpress.org/support/topic-tag/syntax-error/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 4 participants
 * Last reply from: [rabsal](https://wordpress.org/support/users/rabsal/)
 * Last activity: [13 years, 10 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_if-for-php-newbie/#post-2917947)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
