TODO : Ajouter exemple de fichier JS
wp_enqueue_script() : inclure les fichiers JS
<?php function enqueue_style_scripts() { wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/bootstrap/css/bootstrap.min.css', array() ); wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/bootstrap/js/bootstrap.min.js', array('jquery'), '', false); } add_action( 'wp_enqueue_scripts', 'enqueue_style_scripts' );
wp_enqueue_style () : Inclure un fichier CSS
TODO : Finir cette partie
Ajouter un code JavaScript en ligne dans le footer
<?php /** * Add inline JavaScript code in the footer * * @return void */ function wprock_footer_script() { ?> <script> jQuery(document).ready(function() { // Your JavaScript code }) </script> <?php } add_action( 'wp_footer', 'wprock_footer_script' );