lundi 29 décembre 2014

how to add js into wordpress theme


I am trying to create new WordPress theme from scratch. I have working html, css and js files. To add JS into wordpress theme I used:



function my_scripts_styles() {
wp_enqueue_script( 'easing', get_template_directory_uri() . '/js/easing.js', '2014-12-030', true );
}

add_action( 'wp_enqueue_scripts', 'my_scripts_styles' );


this code into function.php


As well as I tried using:



<script src="<?php get_template_directory_uri();?>/js/jquery.min.js"></script>


But it is not working...


What am I doing wrong / how can I add Javascript files to my theme?





Aucun commentaire:

Enregistrer un commentaire