2013-03-13 74 views
0

我开发了一个本地网站wordpress和主题卢加达。 本地一切都可以。我已经转移了ovh上的所有数据。与主题wordpress解析错误

当我想看到什么做我的错误:

Parse error: syntax error, unexpected T_STRING in /homez.705/cadeauxd/www/wp-content/themes/lugada/include/widget.php on line 1

当我在开头加空行是同一件事:1号线

这里的文件:

<?php 
class RecentPost_Widget extends WP_Widget { 

    /* Register widget with WordPress. */ 
    public function __construct() { 
     parent::__construct(
      'recentpost_widget', // Base ID 
      '(Lugada) Recent Post with Thumbnail', // Name 
      array('description' => __('lugada recent post with post-thumbnail support widget.', 'lugada'),) // Args 
     ); 
    } 

    /* Front-end display of widget. */ 
    public function widget($args, $instance) { 
     extract($args); 
     $title = apply_filters('widget_title', $instance['title']); 
     $rcnumber = $instance['rcnumber'] ; 

     echo $before_widget; 
     if (! empty($title)) 
      echo $before_title . $title . $after_title; 
     ?> 
     <?php 
     echo '<ul>'; 
     echo lugada_display_recent_posts($rcnumber); 
     echo '</ul>';?> 
     <?php 
     echo $after_widget; 
    } 

    /* Sanitize widget form values as they are saved. */ 
    public function update($new_instance, $old_instance) { 
     $instance = $old_instance; 
     $instance['title'] = strip_tags($new_instance['title']); 
     $instance['rcnumber'] = strip_tags($new_instance['rcnumber']); 

     return $instance; 
    } 

    /* Back-end widget form. */ 
    public function form($instance) { 
     if ($instance) { 
      $title = esc_attr($instance[ 'title' ]); 
      $rcnumber = esc_attr($instance[ 'rcnumber' ]); 
     } 
     else { 
      $title = __('Recent post', 'lugada'); 
      $rcnumber = __('5', 'lugada'); 
     } 
     ?> 
     <p> 
     <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:','lugada'); ?></label> 
     <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /> 
     </p> 
     <p> 
     <label for="<?php echo $this->get_field_id('rcnumber'); ?>"><?php _e('Number of recent post to show:','lugada'); ?></label> 
     <input class="widefat" id="<?php echo $this->get_field_id('rcnumber'); ?>" name="<?php echo $this->get_field_name('rcnumber'); ?>" type="text" value="<?php echo $rcnumber; ?>" /> 
     </p> 
     <?php 
    } 

} // class RecentPost_Widget 

class RandomPost_Widget extends WP_Widget { 

    /* Register widget with WordPress. */ 
    public function __construct() { 
     parent::__construct(
      'randompost_widget', // Base ID 
      '(Lugada) Random Post', // Name 
      array('description' => __('lugada random post widget.', 'lugada'),) // Args 
     ); 
    } 

    /* Front-end display of widget. */ 
    public function widget($args, $instance) { 
     extract($args); 
     $title = apply_filters('widget_title', $instance['title']); 
     $rndnumber = $instance['rndnumber'] ; 

     echo $before_widget; 
     if (! empty($title)) 
      echo $before_title . $title . $after_title; 
     ?> 
     <?php 
     echo '<ul>'; 
     echo lugada_display_random_posts($rndnumber); 
     echo '</ul>';?> 
     <?php 
     echo $after_widget; 
    } 

    /* Sanitize widget form values as they are saved. */ 
    public function update($new_instance, $old_instance) { 
     $instance = $old_instance; 
     $instance['title'] = strip_tags($new_instance['title']); 
     $instance['rndnumber'] = strip_tags($new_instance['rndnumber']); 

     return $instance; 
    } 

    /* Back-end widget form. */ 
    public function form($instance) { 
     if ($instance) { 
      $title = esc_attr($instance[ 'title' ]); 
      $rndnumber = esc_attr($instance[ 'rndnumber' ]); 
     } 
     else { 
      $title = __('Random post', 'lugada'); 
      $rndnumber = __('5', 'lugada'); 
     } 
     ?> 
     <p> 
     <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:','lugada'); ?></label> 
     <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /> 
     </p> 
     <p> 
     <label for="<?php echo $this->get_field_id('rndnumber'); ?>"><?php _e('Number of random post to show:','lugada'); ?></label> 
     <input class="widefat" id="<?php echo $this->get_field_id('rndnumber'); ?>" name="<?php echo $this->get_field_name('rndnumber'); ?>" type="text" value="<?php echo $rndnumber; ?>" /> 
     </p> 
     <?php 
    } 

} // class RandomPost_Widget 

?> 

回答

0

这个错误通常意味着你有一个未关闭的字符串;规定的行号通常没有意义。还要检查诸如不成对的括号或括号之类的东西,以及您认为使用HTML或PHP编写的地方,但实际上是在编写另一个地方。