• Resolved jtancil

    (@jtancilyahoocom)


    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.