Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I'am getting the following error: "PHP Syntax Check: Parse error: syntax error, unexpected 'qtip' (T_STRING), expecting ')' in your code on line 14" in this code:

<?php
// Always use wp_enqueue_scripts action hook to both enqueue and register scripts
add_action( 'wp_enqueue_scripts', 'enqueue_and_register_qtip_scripts_and_style' );

function enqueue_and_register_qtip_scripts_and_style(){

    // Use `get_stylesheet_directoy_uri() if your script is inside your theme or child theme.
    wp_register_style( 'qtip', get_stylesheet_directory_uri() . '/qtip-js/jquery.qtip.min.css', 'all' );
    wp_register_script( 'imagesloaded', get_stylesheet_directory_uri() . '/qtip-js/imagesloaded.pkg.min.js', true );    
    wp_register_script( 'qtip', get_stylesheet_directory_uri() . '/qtip-js/jquery.qtip.min.js', array('jquery', 'imagesloaded'), false, true );
    wp_register_script( 'tooltip', get_stylesheet_directory_uri() . '/qtip-js/tooltip.js', array('jquery', 'imagesloaded', 'jquery-qtip-min), false, true );

// Add the styles first, in the <head> (last parameter false, true = bottom of page!)
   wp_enqueue_style( 'qtip', null, false, false );

// Using imagesLoaded? Do this.
wp_enqueue_script( 'imagesloaded', null, false, true );
wp_enqueue_script( 'qtip', false, true );
wp_enqueue_script( 'tooltip', false, true );
}
?>

The 14 line says: " wp_enqueue_style( 'qtip', null, false, false ); "

Your help is much appreciated.

share|improve this question

closed as off-topic by Marc B, mario, John Conde, cpilko, Andy Jun 6 '14 at 18:33

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question was caused by a problem that can no longer be reproduced or a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers. This can often be avoided by identifying and closely inspecting the shortest program necessary to reproduce the problem before posting." – Marc B, mario, John Conde, cpilko, Andy
If this question can be reworded to fit the rules in the help center, please edit the question.

1  
You should use a code editor with syntax highlighting. It'll show you EXACTLY where the colors go wrong, which is where you've got your missing '. Since it's a simple typo, voting to close. e.g. look at the code here and see where it goes all-red. –  Marc B Jun 6 '14 at 18:11
1  
looks like you are missing a ' after jquery-qtip-min),false,true) –  Jim Jun 6 '14 at 18:11
    
It's working. Thanks ! –  user52826 Jun 6 '14 at 18:41

3 Answers 3

up vote 0 down vote accepted

Missing ' (single quote) in this line after jquery-qtip-min

 wp_register_script( 'tooltip', get_stylesheet_directory_uri() . '/qtip-js/tooltip.js', array('jquery', 'imagesloaded', 'jquery-qtip-min), false, true );

should be

wp_register_script( 'tooltip', get_stylesheet_directory_uri() . '/qtip-js/tooltip.js', array('jquery', 'imagesloaded', 'jquery-qtip-min'), false, true );
share|improve this answer
    
It's working. Thanks for your help! –  user52826 Jun 6 '14 at 18:43

This line

    wp_register_script( 'tooltip', get_stylesheet_directory_uri() . '/qtip-js/tooltip.js',    array('jquery', 'imagesloaded', 'jquery-qtip-min), false, true );

is missing a quote on the jquery-qtip-min param

share|improve this answer
    
It's working. Thanks for your help! –  user52826 Jun 6 '14 at 18:43
wp_register_script( 'tooltip', get_stylesheet_directory_uri() . '/qtip-js/tooltip.js', array('jquery', 'imagesloaded', 'jquery-qtip-min), false, true );

A single ' is missing after jquery-qtip-min on this line.

share|improve this answer
    
It's working. Thank you ! –  user52826 Jun 6 '14 at 18:42

Not the answer you're looking for? Browse other questions tagged or ask your own question.