Includi jQuery nel tema WordPress - Trucchi CSS

Sommario

Quello che segue è il modo migliore per farlo. Aggiungi quanto segue al file functions.php del tema:

if (!is_admin()) add_action("wp_enqueue_scripts", "my_jquery_enqueue", 11); function my_jquery_enqueue() ( wp_deregister_script('jquery'); wp_register_script('jquery', "http" . ($_SERVER('SERVER_PORT') == 443 ? "s" : "") . "://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js", false, null); wp_enqueue_script('jquery'); )

Sostituisci l'URL con la posizione della versione di jQuery che desideri utilizzare.

Articoli interessanti...