I followed this guide to try to enqueue multiple stylesheets in order to get this file picker to work in Wordpress. However, when I am getting an error that says Parse error: syntax error, unexpected '(', expecting variable (T_VARIABLE) or '$' in /home/effilxhy/public_html/WP/wp-content/themes/blankslate-child/av_question-form.php on line 2. What am I missing here?


<?php ob_start(); ?>

function namespace_theme_stylesheets() {
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    wp_enqueue_style( 'fileinput',  get_template_directory_uri() .'/fileinput.css', array(), null, 'all' );
    wp_enqueue_style( 'fileinput.min',  get_template_directory_uri() .'/fileinput.min.css', array(), null, 'all' );
add_action( 'wp_enqueue_scripts', 'namespace_theme_stylesheets' );


Names of files in WP folder



You need to add the folder that your css is in, so it might look like this if your styles were in 'css':

wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/css/style.css' );
  • Theyre all just in public_html/WP/wp-content/themes/blankslate-child. Wait so does this mean all 3 lines need to have 'parent-style' at the beginning? – cowlicker12 Aug 18 '15 at 23:23
  • Also, do I even need to have multiple stylesheets? Can't I just put all the code into my style.css file? Or might that negatively affect others pages? – cowlicker12 Aug 18 '15 at 23:25
  • You can place them all in one file. That 'parent-style' part can be anything. – amespower Aug 18 '15 at 23:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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