“WordPress Add JQuery Script” Respostas de código

WordPress Add JQuery Script

Here is an example of how your jQuery script 
(in wp-content/themes/your-theme/js/your-scrript.js) might look:

jQuery(document).ready(function($) {
  $('#nav a').last().addClass('last');
})
7uc1f3r

WordPress Add JQuery Script

add_action( 'wp_enqueue_scripts', 'add_my_script' );
function add_my_script() {
    wp_enqueue_script(
        'your-script', // name your script so that you can attach other scripts and de-register, etc.
        get_template_directory_uri() . '/js/your-script.js', // this is the location of your script file
        array('jquery') // this array lists the scripts upon which your script depends
    );
}
7uc1f3r

Respostas semelhantes a “WordPress Add JQuery Script”

Perguntas semelhantes a “WordPress Add JQuery Script”

Mais respostas relacionadas para “WordPress Add JQuery Script” em PHP

Procure respostas de código populares por idioma

Procurar outros idiomas de código