-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththeme-js.php
21 lines (17 loc) · 872 Bytes
/
theme-js.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
add_action( 'wp_enqueue_scripts', 'mycustom_add_javascript' );
if ( ! function_exists( 'mycustom_add_javascript' ) ) {
function mycustom_add_javascript() {
wp_register_script( 'general', get_stylesheet_directory_uri() . '/js/general.js', array( 'jquery' ) );
wp_register_script( 'css3-mediaqueries', get_stylesheet_directory_uri() . '/js/css3-mediaqueries.js', array( 'jquery' ) );
wp_register_script( 'slider-hover', get_stylesheet_directory_uri() . '/js/slider-hover.js', array( 'jquery' ) );
do_action( 'mycustom_add_javascript' );
} // End mycustom_add_javascript()
}
add_action( 'mycustom_add_javascript' , 'mycustom_load_the_js' );
function mycustom_load_the_js() {
wp_enqueue_script( 'general' );
wp_enqueue_script( 'css3-mediaqueries' );
wp_enqueue_script( 'slider-hover' );
}