WordPress PHP code error - HELP!

Hello I’m getting this error on a WP site
Parse error: syntax error, unexpected ‘!’, expecting ‘(’ on line 245 in the functions.php
It’s totally kicked me out and im looking at the line it says effected and cannot seem to find the issue? Here’s the code I’m looking at and the line it’s referencing. The line starting $attrs is line 245

// get video player URL,
$attrs = $media->group->player->attributes();
$obj->watchURL = $attrs[‘url’];

------------------------------------------------Below is the rest of the actual php code------------------------

<?php /** * @package WordPress * @subpackage themename */ /** * Make theme available for translation * Translations can be filed in the /languages/ directory */ load_theme_textdomain( 'themename', get_template_directory() . '/languages' ); $locale = get_locale(); $locale_file = get_template_directory() . "/languages/$locale.php"; if ( is_readable( $locale_file ) ) require_once( $locale_file ); /** * Set the content width based on the theme's design and stylesheet. */ if ( ! isset( $content_width ) ) $content_width = 640; /** * Add jQuery */ function add_jquery_script() { wp_deregister_script( 'jquery' ); wp_register_script( 'jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'); wp_enqueue_script( 'jquery' ); wp_deregister_script( 'gud_rotator' ); wp_register_script( 'gud_rotator', get_stylesheet_directory_uri() . '/inc/js/responsiveslides.min.js'); wp_enqueue_script( 'gud_rotator' ); wp_deregister_script( 'PIE' ); wp_register_script( 'PIE', get_stylesheet_directory_uri() . '/inc/js/PIE.js'); wp_enqueue_script( 'PIE' ); } add_action('wp_enqueue_scripts', 'add_jquery_script'); /** * Remove code from the */ //remove_action('wp_head', 'rsd_link'); // Might be necessary if you or other people on this site use remote editors. //remove_action('wp_head', 'feed_links', 2); // Display the links to the general feeds: Post and Comment Feed //remove_action('wp_head', 'feed_links_extra', 3); // Display the links to the extra feeds such as category feeds //remove_action('wp_head', 'index_rel_link'); // Displays relations link for site index //remove_action('wp_head', 'wlwmanifest_link'); // Might be necessary if you or other people on this site use Windows Live Writer. //remove_action('wp_head', 'start_post_rel_link', 10, 0); // Start link //remove_action('wp_head', 'parent_post_rel_link', 10, 0); // Prev link //remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0); // Display relational links for the posts adjacent to the current post. remove_filter( 'the_content', 'capital_P_dangit' ); // Get outta my Wordpress codez dangit! remove_filter( 'the_title', 'capital_P_dangit' ); remove_filter( 'comment_text', 'capital_P_dangit' ); // Hide the version of WordPress you're running from source and RSS feed // Want to JUST remove it from the source? Try: remove_action('wp_head', 'wp_generator'); /*function hcwp_remove_version() {return '';} add_filter('the_generator', 'hcwp_remove_version');*/ // This function removes the comment inline css /*function twentyten_remove_recent_comments_style() { global $wp_widget_factory; remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) ); } add_action( 'widgets_init', 'twentyten_remove_recent_comments_style' );*/ /** * Remove meta boxes from Post and Page Screens */ function customize_meta_boxes() { /* These remove meta boxes from POSTS */ //remove_post_type_support("post","excerpt"); //Remove Excerpt Support //remove_post_type_support("post","author"); //Remove Author Support //remove_post_type_support("post","revisions"); //Remove Revision Support //remove_post_type_support("post","comments"); //Remove Comments Support //remove_post_type_support("post","trackbacks"); //Remove trackbacks Support //remove_post_type_support("post","editor"); //Remove Editor Support //remove_post_type_support("post","custom-fields"); //Remove custom-fields Support //remove_post_type_support("post","title"); //Remove Title Support /* These remove meta boxes from PAGES */ //remove_post_type_support("page","revisions"); //Remove Revision Support //remove_post_type_support("page","comments"); //Remove Comments Support //remove_post_type_support("page","author"); //Remove Author Support //remove_post_type_support("page","trackbacks"); //Remove trackbacks Support //remove_post_type_support("page","custom-fields"); //Remove custom-fields Support } add_action('admin_init','customize_meta_boxes'); /** * This theme uses wp_nav_menus() for the header menu, utility menu and footer menu. */ register_nav_menus( array( 'primary' => __( 'Primary Menu', 'themename' ), 'footer' => __( 'Footer Menu', 'themename' ), 'utility' => __( 'Utility Menu', 'themename' ) ) ); /** * Add default posts and comments RSS feed links to head */ add_theme_support( 'automatic-feed-links' ); /** * This theme uses post thumbnails */ add_theme_support( 'post-thumbnails' ); /** * This theme supports editor styles */ add_editor_style("/css/layout-style.css"); /** * Remove superfluous elements from the admin bar (uncomment as necessary) */ function remove_admin_bar_links() { global $wp_admin_bar; //$wp_admin_bar->remove_menu('wp-logo'); //$wp_admin_bar->remove_menu('updates'); //$wp_admin_bar->remove_menu('my-account'); //$wp_admin_bar->remove_menu('site-name'); //$wp_admin_bar->remove_menu('my-sites'); //$wp_admin_bar->remove_menu('get-shortlink'); //$wp_admin_bar->remove_menu('edit'); //$wp_admin_bar->remove_menu('new-content'); //$wp_admin_bar->remove_menu('comments'); //$wp_admin_bar->remove_menu('search'); } //add_action('wp_before_admin_bar_render', 'remove_admin_bar_links'); /** * Replace the default welcome 'Howdy' in the admin bar with something more professional. */ function admin_bar_replace_howdy($wp_admin_bar) { $account = $wp_admin_bar->get_node('my-account'); $replace = str_replace('Howdy,', 'Welcome,', $account->title); $wp_admin_bar->add_node(array('id' => 'my-account', 'title' => $replace)); } add_filter('admin_bar_menu', 'admin_bar_replace_howdy', 25); /** * This enables post formats. If you use this, make sure to delete any that you aren't going to use. */ //add_theme_support( 'post-formats', array( 'aside', 'audio', 'image', 'video', 'gallery', 'chat', 'link', 'quote', 'status' ) ); /** * Register widgetized area and update sidebar with default widgets */ function handcraftedwp_widgets_init() { register_sidebar( array ( 'name' => __( 'Sidebar', 'themename' ), 'id' => 'sidebar', 'before_widget' => '", 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'init', 'handcraftedwp_widgets_init' ); /* * Remove senseless dashboard widgets for non-admins. (Un)Comment or delete as you wish. */ function remove_dashboard_widgets() { global $wp_meta_boxes; //unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']); // Plugins widget //unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']); // WordPress Blog widget //unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']); // Other WordPress News widget //unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']); // Right Now widget //unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']); // Quick Press widget //unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']); // Incoming Links widget //unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']); // Recent Drafts widget //unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']); // Recent Comments widget } /** * Hide Menu Items in Admin */ function themename_configure_dashboard_menu() { global $menu,$submenu; global $current_user; get_currentuserinfo(); // $menu and $submenu will return all menu and submenu list in admin panel // $menu[2] = ""; // Dashboard // $menu[5] = ""; // Posts // $menu[15] = ""; // Links // $menu[25] = ""; // Comments // $menu[65] = ""; // Plugins // unset($submenu['themes.php'][5]); // Themes // unset($submenu['themes.php'][12]); // Editor } // For non-admins, add action to Hide Dashboard Widgets and Admin Menu Items you just set above // Don't forget to comment out the admin check to see that changes :) if (!current_user_can('manage_options')) { add_action('wp_dashboard_setup', 'remove_dashboard_widgets'); // Add action to hide dashboard widgets add_action('admin_head', 'themename_configure_dashboard_menu'); // Add action to hide admin menu items } function youtube_id_from_url($url) { $pattern = '%^# Match any youtube URL (?:https?://)? # Optional scheme. Either http or https (?:www\.)? # Optional www subdomain (?: # Group host alternatives youtu\.be/ # Either youtu.be, | youtube\.com # or youtube.com (?: # Group path alternatives /embed/ # Either /embed/ | /v/ # or /v/ | /watch\?v= # or /watch\?v= ) # End path alternatives. ) # End host alternatives. ([\w-]{10,12}) # Allow 10-12 for 11 char youtube id. $%x' ; $result = preg_match($pattern, $url, $matches); if (false !== $result) { return $matches[1]; } return false; } function parseVideoEntry($entry) { $obj= new stdClass; // get author name and feed URL $obj->author = $entry->author->name; $obj->authorURL = $entry->author->uri; // get nodes in media: namespace for media information $media = $entry->children('http://search.yahoo.com/mrss/'); $obj->title = $media->group->title; $obj->description = $media->group->description; // get video player URL, $attrs = $media->group->player->attributes(); $obj->watchURL = $attrs['url']; // get video thumbnail $attrs = $media->group->thumbnail[0]->attributes(); $obj->thumbnailURL = $attrs['url']; // get node for video length $yt = $media->children('http://gdata.youtube.com/schemas/2007'); $attrs = $yt->duration->attributes(); $obj->length = $attrs['seconds']; // get node for viewer statistics $yt = $entry->children('http://gdata.youtube.com/schemas/2007'); $attrs = $yt->statistics->attributes(); $obj->viewCount = $attrs['viewCount']; // get node for video ratings $gd = $entry->children('http://schemas.google.com/g/2005'); if ($gd->rating) { $attrs = $gd->rating->attributes(); $obj->rating = $attrs['average']; } else { $obj->rating = 0; } // get node for video comments $gd = $entry->children('http://schemas.google.com/g/2005'); if ($gd->comments->feedLink) { $attrs = $gd->comments->feedLink->attributes(); $obj->commentsURL = $attrs['href']; $obj->commentsCount = $attrs['countHint']; } // get feed URL for video responses $entry->registerXPathNamespace('feed', 'http://www.w3.org/2005/Atom'); $nodeset = $entry->xpath("feed:link[@rel='http://gdata.youtube.com/ schemas/2007#video.responses']"); if (count($nodeset) > 0) { $obj->responsesURL = $nodeset[0]['href']; } // get feed URL for related videos $entry->registerXPathNamespace('feed', 'http://www.w3.org/2005/Atom'); $nodeset = $entry->xpath("feed:link[@rel='http://gdata.youtube.com/ schemas/2007#video.related']"); if (count($nodeset) > 0) { $obj->relatedURL = $nodeset[0]['href']; } // return object to caller return $obj; } register_sidebar(array( 'name' => __( 'Page Sidebar' ), 'id' => 'sidebar-page', 'description' => __( 'Widgets that will appear in the sidebar of pages' ), 'before_title' => '

', 'after_title' => '

' )); $args = array( 'name' => "Home Page Bucket %d", 'id' => "bucket", 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' ); register_sidebars( 4, $args ); include_once 'metaboxes/setup.php'; include_once 'metaboxes/slider-spec.php'; include_once 'metaboxes/tours-spec.php'; include_once 'metaboxes/videos-spec.php'; include_once 'metaboxes/page-spec.php'; include_once 'inc/cpt-slides.php'; include_once 'inc/cpt-tours.php'; include_once 'inc/cpt-videos.php'; add_image_size( 'bucket-thumb', 200, 101, true ); add_image_size( 'tour-thumb', 162, 92, true ); add_image_size( 'page-thumb', 670,256, true );

The only thing I see that might trigger that is

if ( ! isset( $content_width ) )
$content_width = 640;

The ! shouldn’t have the space after it.

Sponsor our Newsletter | Privacy Policy | Terms of Service