Title: Parse error when widgetizing theme
Last modified: August 19, 2016

---

# Parse error when widgetizing theme

 *  Resolved [jstgtpaid](https://wordpress.org/support/users/jstgtpaid/)
 * (@jstgtpaid)
 * [18 years, 4 months ago](https://wordpress.org/support/topic/parse-error-when-widgetizing-theme/)
 * I am trying to widgetize a theme using the techniques described at this [site](http://automattic.com/code/widgets/themes/).
   I modified the original format of the sidebar.php file to utilize good sidebar
   markup as described in the above page and it works great.
 * I created the functions.php file and added the following into that file…
 * > <?php
   >  if ( function_exists(‘register_sidebar’) ) register_sidebar(); ?>
 * When I add the following code to my sidebar.php file it creates a parse error…
 * > <?php if ( !function_exists(‘dynamic_sidebar’)
   >  || !dynamic_sidebar() ) : ?
   > >
 * Any ideas on how I could fix this or where I could look for additional information?
 * Thanks in advance,
    Steven

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

 *  [Jeremy Clark](https://wordpress.org/support/users/jeremyclark13/)
 * (@jeremyclark13)
 * [18 years, 4 months ago](https://wordpress.org/support/topic/parse-error-when-widgetizing-theme/#post-689929)
 * At the end of your sidebar you need to add the end of the if statement
    `<?php
   endif; ?>`
 *  Thread Starter [jstgtpaid](https://wordpress.org/support/users/jstgtpaid/)
 * (@jstgtpaid)
 * [18 years, 4 months ago](https://wordpress.org/support/topic/parse-error-when-widgetizing-theme/#post-689931)
 * **You are awesome Jeremy** That worked.
 * Thanks…

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

The topic ‘Parse error when widgetizing theme’ is closed to new replies.

## Tags

 * [sidebar](https://wordpress.org/support/topic-tag/sidebar/)
 * [widgetize](https://wordpress.org/support/topic-tag/widgetize/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [jstgtpaid](https://wordpress.org/support/users/jstgtpaid/)
 * Last activity: [18 years, 4 months ago](https://wordpress.org/support/topic/parse-error-when-widgetizing-theme/#post-689931)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
