enque style errors
-
Dear Author,
First off i really appriciate the plugin, although i found a few “mistakes”.
q-and-a-focus-plus-faq/q-and-a-focus-plus.php line #49 to #51
/* Load scripts for front */ wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'q-a-focus-plus', QAFP_URL . '/js/q-a-focus-plus.min.js', false, $qafp_options['version'], true ); wp_enqueue_style( 'q-a-focus-plus', QAFP_URL . '/css/q-a-focus-plus.min.css', false, $qafp_options['version'], 'screen' );
Here you are enqueueing the script and styles directly which isn’t the proper way. Also you are enqueueing jquery which isn’t needed also.
So my suggestion is as followed:
Replace above code with:
/* Load scripts for front */ add_action( 'wp_enqueue_scripts', 'register_faq_scripts' );
Add the following code somewhere in the same file:
function register_faq_scripts() { wp_enqueue_script( 'q-a-focus-plus', QAFP_URL . '/js/q-a-focus-plus.min.js', array( 'jquery' ), $qafp_options['version'], true ); wp_enqueue_style( 'q-a-focus-plus', QAFP_URL . '/css/q-a-focus-plus.min.css', false, $qafp_options['version'], 'screen' ); }
Also why are you using
$qafp_options['version']
instead ofQAFP_VERSION
?
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘enque style errors’ is closed to new replies.