Hi there!
I am having the same problem and after hours I can't find anything. PLEASE HELP!!!!???? Thanks
Parse error: syntax error, unexpected $end in /home/lonely6/public_html/wp-content/themes/viewport/lib/featured-posts-widget.php on line 175

Here is the code from line 175:

<!-- Your Name: Text Input -->
		<p>
			<label for="<?php echo $this->get_field_id( 'count' ); ?>"><?php _e('Number of posts:', 'web2feel'); ?></label>
			<input class="widefat" id="<?php echo $this->get_field_id( 'count' ); ?>" name="<?php echo $this->get_field_name( 'count' ); ?>" value="<?php echo $instance['count']; ?>" style="width:95%;" />
		</p>

<?php
	}

}

?>

    Welcome to PHPBuilder! When posting PHP code, please use the board's [noparse]

    ..

    [/noparse] bbcode tags as they make your code much easier to read and analyze. Also, I've moved your post to a new thread so as not to hijack someone else's older thread.

    The "unexpected $end" error usually means you have an unmatched "{" opening brace. Most (if not all) code editors worth using will offer syntax highlighting as well as matching brace highlighting/locating; try verifying that all of your "{" braces have a matching "}" closing brace for starters. If you still can't spot the error, you'll probably have to post the entire script for us to see (don't forget the bbcode tags).

    EDIT: Also, please don't cross post your issue in multiple threads/forums.

      Thank you so much for your promptness and great advices! I'll have another look

        I am lost, no way I can find the missing THING. Could you be so kind and help me with this one. THANKS!

        <?php
        /**
         * Plugin Name: Blog Widget
         * Plugin URI: http://web2feel.com
         * Description: A widget that displays a featured post section.
         * Version: 0.1
         * Author: Jinsona ( Widget framework courtesy - Justin Tadlock )
         * Author URI: http://web2feel.com , http://justintadlock.com
         *
         * This program is distributed in the hope that it will be useful,
         * but WITHOUT ANY WARRANTY; without even the implied warranty of
         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
         *
         *
         * textdomain() used - web2feel
         *
         *
         */
        
        /**
         * Add function to widgets_init that'll load our widget.
         * @since 0.1
         */
        add_action( 'widgets_init', 'w2f_blog_widgets' );
        
        /**
         * Register our widget.
         * 'Example_Widget' is the widget class used below.
         *
         * @since 0.1
         */
        function w2f_blog_widgets() {
        	register_widget( 'W2F_Blog_Widget' );
        }
        
        /**
         * Example Widget class.
         * This class handles everything that needs to be handled with the widget:
         * the settings, form, display, and update.  Nice!
         *
         * @since 0.1
         */
        class W2F_Blog_Widget extends WP_Widget {
        
        /**
         * Widget setup.
         */
        function W2F_Blog_Widget() {
        	/* Widget settings. */
        	$widget_ops = array( 'classname' => 'w2f_blog_widget', 'description' => __('A widget to display a featured posts section.', 'web2feel') );
        
        	/* Widget control settings. */
        	$control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'w2f_blog_widget' );
        
        	/* Create the widget. */
        	$this->WP_Widget( 'w2f_blog_widget', __('W2F Featured Widget', 'web2feel'), $widget_ops, $control_ops );
        }
        
        /**
         * How to display the widget on the screen.
         */
        function widget( $args, $instance ) {
        	extract( $args );
        
        	/* Our variables from the widget settings. */
        	$title = apply_filters('widget_title', $instance['title'] );
        	$count = $instance['count'];
        	$cats = $instance['posts_cat'];
        	/* Before widget (defined by themes). */
        	echo $before_widget;
        
        	/* Display the widget title if one was input (before and after defined by themes). */
        	if ( $title )
        		echo $before_title . $title . $after_title;
        ?>
        
        
        
        
        
        <div class="blog-widget"> <!-- #################  highlight category-2 #################### -->
        <?php $i = 1;?>
        
        <?php
        	$high_query = new WP_Query(array('cat' => $cats,'posts_per_page'=>$count ) );
        	while ($high_query->have_posts()) : $high_query->the_post();
         ?>
        
        
        <?php if($i == 1):?>
        
        <div class="high-first-item">
        <a href="<?php the_permalink() ?>" ><img class="highmage" src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php get_image_url(); ?>&amp;h=120&amp;w=303&amp;zc=1" alt="" /></a>
        <div class="postmeta">
        	<span class="pmet">Postato il <?php the_time('j - M - Y'); ?> </span>
        </div>	
        
        <h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h3>
        <?php wpe_excerpt('wpe_excerptlength_aside', 'wpe_excerptmore'); ?>
        
        </div>
        
        <?php elseif($i > 1 ):?>
        
        <div class="high-rest-item clearfix">
        <a href="<?php the_permalink() ?>" ><img class="restmage" src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php get_image_url(); ?>&amp;h=60&amp;w=60&amp;zc=1" alt="" /></a>
        <h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h3>
        <div class="postmeta">
        <span class="pmet">Postato il <?php the_time('j - M - Y'); ?> </span>
        </div>
        </div>
         <?php endif; ?>
        
         <?php $i++; ?>
        <?php endwhile; ?>
         <?php wp_reset_query(); ?>
        </div>			
        
        
        
        
        
        
        
        
        <?php
        		/* After widget (defined by themes). */
        		echo $after_widget;
        	}
        
        /**
         * Update the widget settings.
         */
        function update( $new_instance, $old_instance ) {
        	$instance = $old_instance;
        
        	/* Strip tags for title and name to remove HTML (important for text inputs). */
        	$instance['title'] = strip_tags( $new_instance['title'] );
        	$instance['count'] = strip_tags( $new_instance['count'] );
        	$instance['posts_cat'] = ( $new_instance['posts_cat'] );
        	return $instance;
        }
        
        /**
         * Displays the widget settings controls on the widget panel.
         * Make use of the get_field_id() and get_field_name() function
         * when creating your form elements. This handles the confusing stuff.
         */
        function form( $instance ) {
        
        	/* Set up some default widget settings. */
        	$defaults = array( 'title' => __('From the blog', 'web2feel'), 'count' => 3 , 'posts_cat' => __('Uncategorized', 'web2feel'),);
        	$instance = wp_parse_args( (array) $instance, $defaults ); ?>
        
        	<!-- Widget Title: Text Input -->
        	<p>
        		<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e('Title:', 'web2feel'); ?></label>
        		<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" style="width:95%;" />
        	</p>
        
        	<p>
        				<label for="<?php echo $this->get_field_id( 'posts_cat' ); ?>"><?php _e( 'Category', 'web2feel' ); ?>:</label><br/>
        				<?php
        				$categories_args = array(
        					'name'            => $this->get_field_name( 'posts_cat' ),
        					'selected'        => $instance['posts_cat'],
        					'orderby'         => 'Name',
        					'hierarchical'    => 1,
        					'show_option_all' => __( 'All Categories', 'web2feel' ),
        					'hide_empty'      => '0',
        				);
        				wp_dropdown_categories( $categories_args ); ?>
        	</p>
        
        	<!-- Your Name: Text Input -->
        	<p>
        		<label for="<?php echo $this->get_field_id( 'count' ); ?>"><?php _e('Number of posts:', 'web2feel'); ?></label>
        		<input class="widefat" id="<?php echo $this->get_field_id( 'count' ); ?>" name="<?php echo $this->get_field_name( 'count' ); ?>" value="<?php echo $instance['count']; ?>" style="width:95%;" />
        	</p>
        
        <?php
        	}
        
        }
        
        ?>

          Given that this is WordPress:

          1. You might consider asking in a WordPress-specific forum. It appears there are some people over there who have handled this one before.

          2. I would generalize that you're not running "featured-posts-widget.php" standalone, but rather it's being include()d, require()d, or eval()uated from another script? That will certainly make this tougher to debug here on the forums. Can you tell us exactly what actions you take (what page is loaded) that produces this error? Is it true regardless of which theme you are using?

            lonelyfingers;11030147 wrote:

            Could you be so kind and help me with this one.

            Not only are there no syntax errors in the code snippet you posted above, but that snippet is longer than 175 lines (which is the length of "featured-posts-widget.php" as suggested by the error message). Thus, you've either a) shown us the wrong file, or b) have an incomplete copy uploaded to your server.

            dalecosp;11030151 wrote:

            I would generalize that you're not running "featured-posts-widget.php" standalone, but rather it's being include()d, require()d, or eval()uated from another script? That will certainly make this tougher to debug here on the forums.

            Why would it? For parse errors, it doesn't matter where or how the file is being included - you only need to examine the file itself (the one with the parse error, that is).

              Write a Reply...