Title: Parse Error on Conditional Sidebar
Last modified: August 20, 2016

---

# Parse Error on Conditional Sidebar

 *  Resolved [jtancil](https://wordpress.org/support/users/jtancilyahoocom/)
 * (@jtancilyahoocom)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/parse-error-on-conditional-sidebar/)
 * Hello,
    I am a php muddlehead. I am trying to make a conditional sidebar. So,
   if it is on the “Investment Team” page, the visitor will see a special sidebar;
   on all other pages, they will see the usual sidebar.
 * I get this error: Parse error: syntax error, unexpected T_VARIABLE, expecting‘:’
   in /data/15/1/58/53/1384705/user/1485754/htdocs/lionpr/wp-content/themes/lionpress/
   sidebar.php on line 25
 * The code I used is below.
 * Thank you for any help!
    Jeff
 *     ```
       <div id="secondary" class="widget-area" role="complementary">
               <ul class="subnav">
               <?php
       if ( is_page('investment-team') ) {
           echo "testing";
   
       }?>
        <?php
                           elseif($post->post_parent)
                           $children = wp_list_pages('title_li=&child_of='.$post->post_parent.'&echo=0'); else
                           $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');
                           if ($children) { ?>
                           <?php echo $children; ?>
             <?php } } ?>
   
       			</ul><!--end sub-nav-->
       		</div><!-- #secondary .widget-area -->
       <?php endif; ?>
       ```
   

The topic ‘Parse Error on Conditional Sidebar’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [jtancil](https://wordpress.org/support/users/jtancilyahoocom/)
 * Last activity: [14 years, 6 months ago](https://wordpress.org/support/topic/parse-error-on-conditional-sidebar/)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
