Implementing AJAX with wordpress


Advertisements

Registering scripts and styles in wordpress



<?php

// create custom function and then pin it to next add_action()

function add_scripts() {

if(!is_admin()) {
// for css
wp_enqueue_style('css_select', get_template_directory_uri() ."/files/filename.css");

// for javascript

wp_enqueue_script('jquery_check', get_template_directory_uri() ."/files/filename.js");


}

}

//registering the above function in the following line

add_action('wp_enqueue_scripts', 'add_scripts');

?>