website down .help needed
-
Hi
can anyone help me
I was trying to adapt my wp theme(purity)in the editor
I was trying to add a line of text under my wiget area at the “youtube widget php file , I must have deleted some code cause my site has gone down.
its coming up with this message on homepageParse error: syntax error, unexpected ‘}’, expecting ‘,’ or ‘;’ in /home/focalpoi/public_html/wp-content/themes/purity/functions/widget-youtube.php on line 101
here is the code for that widget-youtube.php file
I think something must be missing, thanks<?php /* Plugin Name: YouTube Plugin URI: https://themeforest.net/user/Tauris/ Description: Display a YouTube video. Version: 1.0 Author: Tauris Author URI: https://themeforest.net/user/Tauris/ */ /* Add our function to the widgets_init hook. */ add_action( 'widgets_init', 'pr_widget_youtube' ); /* Function that registers our widget. */ function pr_widget_youtube() { register_widget( 'PR_Widget_Youtube' ); } // Widget class. class PR_Widget_Youtube extends WP_Widget { function PR_Widget_Youtube() { /* Widget settings. */ $widget_ops = array( 'classname' => 'pr_widget_youtube', 'description' => 'Display a YouTube video.' ); /* Create the widget. */ $this->WP_Widget( 'pr_widget_youtube', '(C) YouTube', $widget_ops ); } function widget( $args, $instance ) { extract( $args ); /* User-selected settings. */ $title = apply_filters('widget_title', $instance['title'] ); $width = $instance['width']; $height = $instance['height']; $id = $instance['id']; /* Before widget (defined by themes). */ echo $before_widget; /* Title of widget (before and after defined by themes). */ if ( $title ) echo $before_title . $title . $after_title; /* Display name from widget settings. */ ?> <iframe width="<?php echo $width ?>" height="<?php echo $height ?>" src="https://www.youtube.com/embed/<?php echo $id ?>" frameborder="0" allowfullscreen></iframe> <?php /* After widget (defined by themes). */ echo $after_widget; } function update( $new_instance, $old_instance ) { $instance = $old_instance; /* Strip tags (if needed) and update the widget settings. */ $instance['title'] = strip_tags( $new_instance['title'] ); $instance['width'] = strip_tags( $new_instance['width'] ); $instance['height'] = strip_tags( $new_instance['height'] ); $instance['id'] = strip_tags( $new_instance['id'] ); return $instance; } function form( $instance ) { /* Set up some default widget settings. */ $defaults = array( 'title' => 'YouTube Video', 'width' => '198', 'height' => '150', 'id' => 'YW8p8JO2hQw'); $instance = wp_parse_args( (array) $instance, $defaults ); ?> <p> <label for="<?php echo $this->get_field_id( 'title' ); ?>">Title:</label> <input id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $instance['title']; ?>" style="width:100%;" /> </p> <p> <label for="<?php echo $this->get_field_id('width'); ?>">Width:</label> <input id="<?php echo $this->get_field_id('width'); ?>" name="<?php echo $this->get_field_name('width'); ?>" type="text" value="<?php echo $instance['width']; ?>" size="3" /> </p> <p> <label for="<?php echo $this->get_field_id('height'); ?>">Height:</label> <input id="<?php echo $this->get_field_id('height'); ?>" name="<?php echo $this->get_field_name('height'); ?>" type="text" value="<?php echo $instance['height']; ?>" size="3" /> </p> <p> <label for="<?php echo $this->get_field_id('id'); ?>">Video ID:</label> <input id="<?php echo $this->get_field_id('id'); ?>" name="<?php echo $this->get_field_name('id'); ?>" type="text" value="<?php echo $ins }
[Moderator Note: Please post code or markup snippets between backticks or use the code button. Or better still – use the pastebin. As it stands, your code may now have been permanently damaged/corrupted by the forum’s parser.]
- The topic ‘website down .help needed’ is closed to new replies.