Click to See Complete Forum and Search --> : Parse error: parse error, unexpected $


yodasw16
09-12-2007, 03:23 PM
I am working on integrating a wordpress blog into a site I am making. I am getting this error:
---
Parse error: parse error, unexpected $ in /home/content/t/h/e/thedogjogger/html/blog/wp-content/themes/wp theme/sidebar.php on line 71
---
here is "sidebar.php" if someone can have a look and tell me if they see something I am missing. Thanks


<div id="rightcolumn">
<h3 class="rightbox" id="linktext">Blog Links</h3>
<p class="feed"><a href="<?php bloginfo('rss2_url'); ?>" title="<?php _e('Syndicate this site using RSS'); ?>"><img src="http://www.thedogjogger.com/images/feedicon.png" alt="RSS Feed" title="RSS Feed" width="14" height="14" /> RSS Feed</a></p>
<p class="feed"><a href="<?php bloginfo('comments_rss2_url'); ?>" title="<?php _e('The latest comments to all posts in RSS'); ?>"><img src="http://www.thedogjogger.com/images/feedicon.png" alt="Comments RSS Feed" title="Comments RSS Feed" width="14" height="14" /> Comments RSS Feed</a></p>

<div id="sidebar">

<?php /* Widgetized sidebar, if you have the plugin installed. */
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>

<?php if ( is_404() || is_category() || is_day() || is_month() ||
is_year() || is_search() || is_paged() ) {
?>

<?php /* If this is a 404 page */ if (is_404()) { ?>
<?php /* If this is a category archive */ } elseif (is_category()) { ?>
<p>You are currently browsing the archives for the <?php single_cat_title(''); ?> category.</p>

<?php /* If this is a yearly archive */ } elseif (is_day()) { ?>
<p>You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> weblog archives
for the day <?php the_time('l, F jS, Y'); ?>.</p>

<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
<p>You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> weblog archives
for <?php the_time('F, Y'); ?>.</p>

<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
<p>You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> weblog archives
for the year <?php the_time('Y'); ?>.</p>

<?php /* If this is a monthly archive */ } elseif (is_search()) { ?>
<p>You have searched the <a href="<?php echo bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> weblog archives
for <strong>'<?php the_search_query(); ?>'</strong>. If you are unable to find anything in these search results, you can try one of these links.</p>

<?php /* If this is a monthly archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<p>You are currently browsing the <a href="<?php echo bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> weblog archives.</p>

<?php } ?>


<h5>Blogroll</h5>
<ul class="rightbox borderedlist_r">
<?php get_links_list('name'); ?>
</ul>



<h5>Categories</h5>
<ul class="rightbox borderedlist_r">
<?php wp_list_categories('orderby=name&show_count=1&title_li='); ?>
</ul>



<h5>Archives</h5>
<ul class="rightbox borderedlist_r">
<?php wp_get_archives('type=monthly'); ?>
</ul>

<h5>Admin</h5>
<ul class="rightbox borderedlist_r">
<li><?php wp_loginout(); ?></li>
<li>Powered by <a href="http://wordpress.org/" title="Powered by WordPress, state-of-the-art semantic personal publishing platform.">WordPress</a></li>
</ul>



</div>
</div>

michael879
09-12-2007, 04:58 PM
nope sorry I cant find anything wrong. However it might be easier for anyone trying to help you if you point out which line 71 is..

NogDog
09-12-2007, 06:01 PM
You have 8 "{" but only 7 "}", so you need to go through it and figure out which block was not closed.

NogDog
09-12-2007, 06:10 PM
PS: It also looks as if you have an alternate syntax if statement using if (<condition>) : but no closing endif;.

I would suggest (a) indenting your code so that corresponding if statements and their closing brackets line up more clearly, and (b) whenever you type something like an if or elseif statement with its opening "{" you get in the habit of immediately typing its closing "}" and [i]then start typing the code that goes between them.

yodasw16
09-13-2007, 11:52 AM
I got it to work. Nothing I was doing would work, so I rewrote it and took out a few things and now it works. Here is the code I now have:



<div id="rightcolumn">
<h3 class="rightbox" id="linktext">Blog Links</h3>
<p class="feed"><a href="<?php bloginfo('rss2_url'); ?>" title="<?php _e('Syndicate this site using RSS'); ?>"><img src="http://www.thedogjogger.com/images/feedicon.png" alt="RSS Feed" title="RSS Feed" width="14" height="14" /> RSS Feed</a></p>
<p class="feed"><a href="<?php bloginfo('comments_rss2_url'); ?>" title="<?php _e('The latest comments to all posts in RSS'); ?>"><img src="http://www.thedogjogger.com/images/feedicon.png" alt="Comments RSS Feed" title="Comments RSS Feed" width="14" height="14" /> Comments RSS Feed</a></p>

<div id="sidebar">



<?php /* If this is a 404 page */ if (is_404()) { ?>
<?php /* If this is a category archive */ } elseif (is_category()) { ?>
<p>You are currently browsing the archives for the <?php single_cat_title(''); ?> category.</p>

<?php /* If this is a yearly archive */ } elseif (is_day()) { ?>
<p>You are currently browsing the <a href="<?php bloginfo('home'); ?>/"><?php echo bloginfo('name'); ?></a> weblog archives
for the day <?php the_time('l, F jS, Y'); ?>.</p>

<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
<p>You are currently browsing the <a href="<?php bloginfo('home'); ?>/"><?php echo bloginfo('name'); ?></a> weblog archives
for <?php the_time('F, Y'); ?>.</p>

<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
<p>You are currently browsing the <a href="<?php bloginfo('home'); ?>/"><?php echo bloginfo('name'); ?></a> weblog archives
for the year <?php the_time('Y'); ?>.</p>

<?php /* If this is a monthly archive */ } elseif (is_search()) { ?>
<p>You have searched the <a href="<?php echo bloginfo('home'); ?>/"><?php echo bloginfo('name'); ?></a> weblog archives
for <strong>'<?php the_search_query(); ?>'</strong>. If you are unable to find anything in these search results, you can try one of these links.</p>

<?php /* If this is a monthly archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<p>You are currently browsing the <a href="<?php echo bloginfo('home'); ?>/"><?php echo bloginfo('name'); ?></a> weblog archives.</p>

<?php } ?>

<h5>Blogroll</h5>
<ul class="rightbox borderedlist_r">
<?php get_links_list('name'); ?>
</ul>



<h5>Categories</h5>
<ul class="rightbox borderedlist_r">
<?php wp_list_categories('orderby=name&show_count=0&title_li='); ?>
</ul>



<h5>Archives</h5>
<ul class="rightbox borderedlist_r">
<?php wp_get_archives('type=monthly'); ?>
</ul>

<h5>Admin</h5>
<ul class="rightbox borderedlist_r">
<li><?php wp_loginout(); ?></li>
<li>Powered by <a href="http://wordpress.org/" title="Powered by WordPress, state-of-the-art semantic personal publishing platform.">WordPress</a></li>
</ul>



</div>
</div>
<hr />
</div>
</div>