Created
June 26, 2016 13:00
-
-
Save SiGaCode/a13bb7123996670ab91c4ff36805a98d to your computer and use it in GitHub Desktop.
If you’re enqueuing a script that requires additional Javascript to run properly (ex: targeting the proper div for your carousel and adding parameters), add that as an inline script rather than creating a separate JS file.
(c) Bill Erickson, http://www.billerickson.net/code/add-inline-script/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $gallery = ea_cf( 'ea_product_gallery' ); | |
| if( $gallery ) { | |
| wp_enqueue_script( 'slick' ); | |
| wp_add_inline_script( 'slick', 'jQuery(document).ready(function($){$(".product-gallery").slick({autoplay: false, arrows: false, dots: true, });});' ); | |
| // output gallery | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment