-
-
Save blueprintmrk/bd8ef0953add3f91498e25caa22524b9 to your computer and use it in GitHub Desktop.
WordPress Enqueues
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
function my_assets() { | |
wp_register_script( 'owl-carousel', get_stylesheet_directory_uri() . '/owl.carousel.js', array( 'jquery' ) ); | |
wp_enqueue_script( 'owl-carousel' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'my_assets' ); |
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
function my_assets() { | |
wp_enqueue_style( 'theme-style', get_stylesheet_uri(), array( 'reset' ) ); | |
wp_enqueue_style( 'reset', get_stylesheet_directory_uri() . '/reset.css' ) ); | |
wp_enqueue_script( 'owl-carousel', get_stylesheet_directory_uri() . '/owl.carousel.js', array( 'jquery' ) ); | |
wp_enqueue_script( 'theme-scripts', get_stylesheet_directory_uri() . '/website-scripts.js', array( 'owl-carousel', 'jquery' ), '1.0', true ); | |
} | |
add_action( 'wp_enqueue_scripts', 'my_assets' ); |
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
wp_enqueue_script( $handle, $source, $dependencies, $version, $in_footer ); | |
wp_enqueue_style( $handle, $source, $dependencies, $version, $media ); |
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
function my_assets() { | |
wp_deregister_script( 'jquery' ); | |
wp_register_script( 'jquery', get_template_directory_uri() . '/jquery-latest.js' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'my_assets' ); |
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
<!DOCTYPE html> | |
<head> | |
<script type='text/javascript' src='jquery.js'> | |
<script type='text/javascript' src='owl.carousel.js'></script> | |
<link rel='stylesheet' type='text/css' href='reset.css'> | |
<link rel='stylesheet' type='text/css' href='styles.css'> | |
</head> | |
<body> | |
Website content here | |
<script type='text/javascript' src='website-scripts.js'></script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment