-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
71 lines (53 loc) · 1.61 KB
/
functions.php
File metadata and controls
71 lines (53 loc) · 1.61 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
/**
* Register Bootstrap and enabling jquery
*/
function load_css()
{
wp_register_style('bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css',
array(), false, 'all');
wp_enqueue_style('bootstrap');
wp_register_style('main', get_template_directory_uri() . '/css/main.css',
array(), false, 'all');
wp_enqueue_style('main');
}
add_action('wp_enqueue_scripts', 'load_css');
function load_js() {
wp_enqueue_script('jquery');
wp_enqueue_script( 'bootstrap_js', get_template_directory_uri() . '/js/bootstrap.min.js',
array('jquery'), false, true);
}
add_action( 'wp_enqueue_scripts', 'load_js');
add_theme_support("menus");
register_nav_menus(
array(
'top-menu' => 'Top Menu Location',
'mobile-menu' => 'Mobile Menu Location'
)
);
/**
* Register Custom Navigation Walker
*/
function register_navwalker(){
require_once get_template_directory() . '/class-wp-bootstrap-navwalker.php';
}
add_action( 'after_setup_theme', 'register_navwalker' );
/**
* Font Awesome Kit Setup
*
* This will add your Font Awesome Kit to the front-end, the admin back-end,
* and the login screen area.
*/
if (! function_exists('fa_custom_setup_kit') ) {
function fa_custom_setup_kit($kit_url = '') {
foreach ( [ 'wp_enqueue_scripts', 'admin_enqueue_scripts', 'login_enqueue_scripts' ] as $action ) {
add_action(
$action,
function () use ( $kit_url ) {
wp_enqueue_script( 'font-awesome-kit', $kit_url, [], null );
}
);
}
}
}
fa_custom_setup_kit('https://kit.fontawesome.com/f231d52fa1.js');