Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING
Results 1 to 2 of 2

Thread: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING

  1. #1
    Junior Member
    Join Date
    Aug 2013
    Posts
    1

    Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING

    I manage a small little media website and went to add a string of code to the end to enable infinite scroll. I literally cut and pasted this cut to the very, very end of my existing code in my theme-functions.php file and I got this error:

    Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/content/57/10515757/html/wp-content/themes/super-agency/functions.php on line 850

    I searched Google and other similar topics in this forum and cannot for the life of me see where my error is. Since I literally only added to the end of the page and did NOT touch any code elsewhere, what the hell is causing this??? Any help would be GREATLY appreciated....the site is www.imaginatemedia.com Due to length restrictions, I've only submitted a portion of the code, near the end of the page, where I suspect the problem lies.


    function wf_theme_box_portfolio() {
    global $post;
    $video = get_post_meta($post->ID, '_wf_theme_portfolio_video', true);
    $link = get_post_meta($post->ID, '_wf_theme_portfolio_link', true);

    wp_nonce_field('wf_theme_save', 'wf_theme_nonce');
    echo '<p><label for="wf_theme_video">Video:</label> <input type="text" value="' . $video . '" class="regular-text" name="wf_theme_portfolio_video" id="wf_theme_video" /><br/>
    <i>If you want to open a video in the lightbox anter it in the following form: xxx</i></p>';
    echo '<p><label for="wf_theme_link">External Link:</label> <input type="text" value="' . $link . '" class="regular-text" name="wf_theme_portfolio_link" id="wf_theme_link" /><br>
    <i>If you want the thumbnail to link to an external resource enter the full URL, ie: http://google.com</i></p>';
    } // wf_theme_box_portfolio

    function wf_theme_box_staff() {
    global $post;
    $twitter = get_post_meta($post->ID, '_wf_theme_twitter', true);
    $facebook = get_post_meta($post->ID, '_wf_theme_facebook', true);
    $linkedin = get_post_meta($post->ID, '_wf_theme_linkedin', true);
    $google = get_post_meta($post->ID, '_wf_theme_google', true);
    $pinterest = get_post_meta($post->ID, '_wf_theme_pinterest', true);

    wp_nonce_field('wf_theme_save', 'wf_theme_nonce');
    echo '<p><label for="wf_theme_twitter">Twitter:</label> <input type="text" value="' . $twitter . '" class="regular-text" name="wf_theme_twitter" id="wf_theme_twitter" /></p>';
    echo '<p><label for="wf_theme_facebook">Facebook:</label> <input type="text" value="' . $facebook . '" class="regular-text" name="wf_theme_facebook" id="wf_theme_facebook" /></p>';
    echo '<p><label for="wf_theme_linkedin">LinkedIn:</label> <input type="text" value="' . $linkedin . '" class="regular-text" name="wf_theme_linkedin" id="wf_theme_linkedin" /></p>';
    echo '<p><label for="wf_theme_google">Google+:</label> <input type="text" value="' . $google . '" class="regular-text" name="wf_theme_google" id="wf_theme_google" /></p>';
    echo '<p><label for="wf_theme_pinterest">Pinterest:</label> <input type="text" value="' . $pinterest . '" class="regular-text" name="wf_theme_pinterest" id="wf_theme_pinterest" /></p>';

    echo '<p><i>' . __('Please write full links, ie: "https://twitter.com/WebFactoryLtd". Leave any field blank to omit the icon for this staff memeber.', WF_THEME_TEXTDOMAIN) . '</i></p>';
    } // wf_theme_box_staff

    function wf_theme_pre_get_posts($query) {
    if (isset($query->query_vars['post_type']) && $query->query_vars['post_type'] == 'staff' && !is_admin()) {
    $query->query_vars['posts_per_page'] = 6;
    }

    return $query;
    } // wf_theme_pre_get_posts
    add_filter('pre_get_posts', 'wf_theme_pre_get_posts');


    function wf_theme_admin_style() {
    echo '<style type="text/css" media="screen">
    #menu-posts-staff .wp-menu-image {
    background: url(' . get_template_directory_uri() . '/admin/images/staff.png) no-repeat 6px -17px !important;
    }
    #menu-posts-staff:hover .wp-menu-image, #menu-posts-staff.wp-has-current-submenu .wp-menu-image {
    background-position:6px 7px!important;
    }
    #menu-posts-portfolio .wp-menu-image {
    background: url(' . get_template_directory_uri() . '/admin/images/portfolio.png) no-repeat 6px -17px !important;
    }
    #menu-posts-portfolio:hover .wp-menu-image, #menu-posts-portfolio.wp-has-current-submenu .wp-menu-image {
    background-position:6px 7px!important;
    }
    </style>' . "\n";
    } // wf_theme_admin_style
    add_action('admin_head', 'wf_theme_admin_style');


    function wf_theme_create_post_types() {
    register_post_type('staff',
    array(
    'labels' => array('name' => __('Staff Members', WF_THEME_TEXTDOMAIN), 'singular_name' => __('Staff Member', WF_THEME_TEXTDOMAIN), 'add_new' => __('Add New Staff Member', WF_THEME_TEXTDOMAIN), 'add_new_item' => __('Add New Staff Member', WF_THEME_TEXTDOMAIN)),
    'public' => true,
    'has_archive' => true,
    'taxonomies' => array('skill'),
    'supports' => array('title', 'editor', 'thumbnail'),
    'rewrite' => false)
    );
    register_post_type('portfolio',
    array(
    'labels' => array('name' => __('Portfolio', WF_THEME_TEXTDOMAIN), 'singular_name' => __('Portfolio', WF_THEME_TEXTDOMAIN), 'add_new' => __('Add New Portfolio Item', WF_THEME_TEXTDOMAIN), 'add_new_item' => __('Add New Portfolio Item', WF_THEME_TEXTDOMAIN)),
    'public' => true,
    'has_archive' => true,
    'taxonomies' => array('type'),
    'supports' => array('title', 'excerpt', 'thumbnail'),
    'rewrite' => false)
    );
    } // wf_theme_create_post_type
    add_action('init', 'wf_theme_create_post_types');

    function wf_theme_create_taxonomies() {
    register_taxonomy('skill', array('staff'),
    array(
    'labels' => array('name' => __('Skills', WF_THEME_TEXTDOMAIN), 'singular_name' => __('Skill', WF_THEME_TEXTDOMAIN)),
    'public' => true,
    'show_in_nav_menus' => false,
    'show_tagcloud' => false,
    'query_var' => false,
    'rewrite' => false)
    );
    register_taxonomy('type', array('portfolio'),
    array(
    'labels' => array('name' => __('Types', WF_THEME_TEXTDOMAIN), 'singular_name' => __('Type', WF_THEME_TEXTDOMAIN)),
    'public' => true,
    'show_in_nav_menus' => false,
    'show_tagcloud' => false,
    'query_var' => false,
    'rewrite' => false)
    );
    } // wf_theme_create_post_type
    add_action('init', 'wf_theme_create_taxonomies');

    function wf_theme_ajax_captcha() {
    if (isset($_REQUEST['check'])) {
    if ($_REQUEST['captcha'] == $_SESSION['captcha']) {
    wp_die('true');
    } else {
    wp_die('false');
    }
    } else {
    $a = rand(0, 10);
    $b = rand(0, 10);

    if ($a > $b) {
    $out = "$a - $b";
    $_SESSION['captcha'] = $a - $b;
    } else {
    $out = "$a + $b";
    $_SESSION['captcha'] = $a + $b;
    }
    wp_die($out);
    }
    }
    add_action('wp_ajax_wf_theme_captcha', 'wf_theme_ajax_captcha');
    add_action('wp_ajax_nopriv_wf_theme_captcha', 'wf_theme_ajax_captcha');

    function wf_theme_ajax_contact_send() {
    $details = $extra_details = '';
    $ok = 0;

    $details .= 'Name: ' . $_POST['name'] . "\r\n";
    $details .= 'Email: ' . $_POST['email'] . "\r\n";
    $details .= 'Message: ' . $_POST['message'] . "\r\n";

    $extra_details .= 'IP address: ' . $_SERVER['REMOTE_ADDR'] . "\r\n";
    $extra_details .= 'User agent: ' . $_SERVER['HTTP_USER_AGENT'] . "\r\n";

    $admin = "Someone has contacted you trough the site's contact form with the following details:\r\n{$details}{$extra_details}\r\nYou can reply to this email to respond.";

    $body = wf_theme_get_option('contact_form_email_body');
    $body .= "\r\n" . $details . $extra_details;

    $headers = 'Reply-to: ' . $_POST['name'] . ' <' . $_POST['email'] . '>' . "\r\n";
    $headers .= 'From: ' . get_bloginfo('name') . ' <' . get_bloginfo('admin_email') . '>' . "\r\n";
    $ok += wp_mail(wf_theme_get_option('contact_form_email_address'), wf_theme_get_option('contact_form_email_subject'), $body, $headers);

    wp_die($ok);
    }
    add_action('wp_ajax_wf_theme_contact_send', 'wf_theme_ajax_contact_send');
    add_action('wp_ajax_nopriv_wf_theme_contact_send', 'wf_theme_ajax_contact_send');

    function wf_theme_body_class() {
    if (is_front_page()) {
    $tmp = get_body_class();
    foreach ($tmp as $i => $class) {
    if ($class == 'page') {
    unset($tmp[$i]);
    break;
    }
    }
    echo 'class="' . join(' ',$tmp ) . '"';
    } else {
    body_class('page');
    }
    } // wf_theme_body_class

  2. #2
    Pedantic Curmudgeon Weedpacket's Avatar
    Join Date
    Aug 2002
    Location
    General Systems Vehicle "Thrilled To Be Here"
    Posts
    21,885
    How about saving us a lot of hassle and just show us the relevant bit of the code (use the forum markup tags described in the FAQs when doing this). Say ... oooh, line 850?
    THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER
    FAQs! FAQs! FAQs! Most forums have them!
    Search - Debugging 101 - Collected Solutions - General Guidelines - Getting help at all

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •