-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
48 lines (42 loc) · 1.64 KB
/
functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
function add_theme_scripts_styles() {
global $post;
if( is_page() || is_single() )
{
wp_enqueue_style( 'general.css', get_template_directory_uri() . '/css/general.css' );
wp_enqueue_script('general.js', get_template_directory_uri() . '/js/general.js', array('jquery'), '', false);
switch($post->post_name) // Post/Page slug used, not the Title
{
case 'index':
wp_enqueue_style ('index.css', get_template_directory_uri() . '/css/index.css' );
break;
case 'vbi':
wp_enqueue_script('vbi.js', get_template_directory_uri() . '/js/vbi.js', array('jquery'), '', false);
wp_enqueue_style ('vbi.css', get_template_directory_uri() . '/css/vbi.css' );
break;
case 'vc':
wp_enqueue_style ('vc.css', get_template_directory_uri() . '/css/vc.css' );
break;
case 'projects':
wp_enqueue_style ('projects.css', get_template_directory_uri() . '/css/projects.css' );
break;
case 'careers':
wp_enqueue_style ('careers.css', get_template_directory_uri() . '/css/careers.css' );
break;
}
wp_localize_script( 'general.js', 'assetsPath', ASSETS_PATH);
}
}
add_action('wp_enqueue_scripts', 'add_theme_scripts_styles');
// register_nav_menus(array(
// 'nav' => __('NavBar')
// ));
if( !defined(ASSETS_PATH)){
define( 'ASSETS_PATH', get_stylesheet_directory_uri() . '/assets/' );
}
if( !defined(JS_PATH)){
define( 'JS_PATH', get_stylesheet_directory_uri() . '/js/' );
}
/* <img src="<?php echo ASSETS_PATH; ?>/images/FileName.png" alt=""/> */
$assets_array = array( 'path' => ASSETS_PATH );
?>