mardi 17 février 2015

Running Javascript in wordpress


I'm creating a word press theme , this includes a responsive jquery menu.


However, for some reason, I can't get the menu to work. In my functions.PHP file I have included the script below. Please may someone help with advice and a code snippet, i'm trying to:


1) Call Jquery


2) Run the script slimmenu.js script



<?php

function menu_function() {
wp_enqueue_script( 'myscript', get_template_directory_uri() . '/js/jquery.slimmenu.js', array( 'jquery'));
}

add_action('wp_enqueue_scripts','menu_function');

?>


Many thanks, P





Aucun commentaire:

Enregistrer un commentaire