WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Parse error: syntax error, unexpected $end (7 posts)

  1. windstyles
    Member
    Posted 1 year ago #

    Today I upgraded my site to 3.5.1. All was running well until I decided to add a post widget to the sidebar. It kept giving me parse errors when trying to click on any of the post links.

    I have searched and tried everything - reinstalled the the wp-includes folder from a fresh download of WP 3.5.1, used an old backup copy of the functions.php file, renamed theme and plugin folder to see if it would "force" wordpress to use a different theme, etc. And nothing seems to work. I get this error:

    Parse error: syntax error, unexpected $end in /home/content/f/l/o/flowrite1/html/flowrite/wp-content/themes/bluehorizon/functions.php on line 65

    Here is my functions.php file:

    <?php
    if ( function_exists('register_sidebar') )
        register_sidebar(array(
            'before_widget' => '<li>',
        'after_widget' => '</li>',
     'before_title' => '<h4>',
            'after_title' => '</h4>',
        ));
    
    // WP-mapleleaf Pages Box
    	function widget_mapleleaf_pages() {
    ?>
    
    <h4><?php _e('Pages'); ?></h4>
       <ul>
    <li class="page_item"><a href="<?php bloginfo('url'); ?>">Home</a></li>
    
    <?php wp_list_pages('title_li='); ?>
    
     </ul>
    
    <?php
    }
    if ( function_exists('register_sidebar_widget') )
        register_sidebar_widget(__('Pages'), 'widget_mapleleaf_pages');
    
    // WP-mapleleaf Search Box
    	function widget_mapleleaf_search() {
    ?>
    
     <ul>
    <li>
       <label for="s"><h4><?php _e('Search Posts'); ?></h4></label>
       <form id="searchform" method="get" action="<?php bloginfo('url'); ?>/index.php">
    
                <input type="text" name="s" size="18" /><br>
    
                <input type="submit" id="submit" name="Submit" value="Search" />
    
    	</form>
    
    </li>
    </ul>
    
    <?php
    }
    if ( function_exists('register_sidebar_widget') )
        register_sidebar_widget(__('Search'), 'widget_mapleleaf_search');
    
    // WP-mapleleaf Blogroll
    	function widget_mapleleaf_blogroll() {
    ?>
    
    <h4><?php _e('Blogroll'); ?></h4>
    
    <ul>
    
    <?php get_links(-1, '<li>', '</li>', '', FALSE, 'name', FALSE, FALSE, -1, FALSE); ?>
    
    </ul>
    
    <?php
    }
    if ( function_exists('register_sidebar_widget') )
        register_sidebar_widget(__('Blogroll'), 'widget_mapleleaf_blogroll');
    
    ?>

    This file has been working great until today...

    I would truly appreciate any help!!!

    Thank you!!

  2. windstyles
    Member
    Posted 1 year ago #

    I failed to mention... now my site is down, with these errors on the dashboard and the website itself. So, I cannot get into dashboard to make changes. Am trying to do it all via cpanel file manager and FTP.
    Thanks again!

  3. kmessinger
    Volunteer Moderator
    Posted 1 year ago #

    What version did you upgrade from? Is this the theme http://www.wordpressthemesblog.com/blue-horizon.html - the reason I ask is that theme demo uses wp 2.3.1

  4. windstyles
    Member
    Posted 1 year ago #

    Sorry, not 100% sure but think I was on 3.1.2. Again, all seemed to be working fine after the upgrade, with the exception of the posts/categories. But, I had not used them before, just decided today I wanted to.

    Can I go back to an older version? Should I just try to restore from backup the entire site and see if that helps? Not even sure how I'd do this since I cannot get into the dashboard....

    Or, is there something else I can try (edit the above code?) that may help restore the site, even if the categories/posts don't work in sidebar?

    Thank you!!!

  5. kmessinger
    Volunteer Moderator
    Posted 1 year ago #

    It is difficult to go back even if you have a backup of the database before the upgrade.

    Using either method you have available rename themes/blue-horizon to themes/blue-horizonx. That should load the default wp theme and get you back into the dashboard.

  6. windstyles
    Member
    Posted 1 year ago #

    Thank you, but I did try that and it failed too.
    But, I overwrote the functions.php file with the file from the default theme and it got me back up and running! Of course, except for the posts/categories in the widget area.. they still give me errors.

    I get this error:
    Parse error: syntax error, unexpected '<' in /home/content/f/l/o/flowrite1/html/flowrite/wp-content/themes/bluehorizon/index.php on line 12

    <?php
    @include("Mobile_Detect.php");
    $detect = new Mobile_Detect();
    if ($detect->isMobile() && isset($_COOKIE['mobile']))
    {
    $detect = "false";
    }
    elseif ($detect->isMobile())
    {
    header("Location:http://m.flow-riteplumbing.com");
    }
    <?php 
    
    include_once('gravatar.php');
    
    get_header();
    ?>
    
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    }
    
    <div class="post">
    	 <h3 class="storytitle" id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
    	<div class="meta"><?php the_category(',') ?> — <?php the_time('l, F j, Y') ?>  <?php edit_post_link(__('Edit This')); ?></div>
    
    	<div class="storycontent">
    		<?php the_content(__('(Read on ...)')); ?>
    	</div>
    
    	<div class="feedback">
                <?php wp_link_pages(); ?>
                <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
    	</div>
    
    	<!--
    	<?php trackback_rdf(); ?>
    	-->
    
    </div>
    
    <?php comments_template(); ?>
    
    <?php endwhile; else: ?>
    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    <?php endif; ?>
    
    <?php posts_nav_link(' — ', __('&laquo; Previous Page'), __('Next Page &raquo;')); ?>
    
    <?php get_footer(); ?>

    This was the original problem I was having, before I broke everything :) Any ideas?

    Thank you!!

  7. windstyles
    Member
    Posted 1 year ago #

    I think I've got it... with a small exception and I will open a new topic for that one :)

    I needed to add the closing tag ?> on line 12.

    This fixed my trouble with posts/categories.
    Thank you, kmessinger, for your help!! :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.