-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
54 lines (29 loc) · 1.08 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
49
50
51
52
53
54
<?php
if (!defined('ABSPATH')) exit;
// set up theme support
function vi_theme_setup() {
add_theme_support('post-thumbnails');
add_theme_support('automatic-feed-links');
add_theme_support('title-tag');
}
add_action('after_setup_theme', 'vi_theme_setup');
// conditional parent/child styles
function vi_theme_styles() {
// always load active theme stylesheet
wp_enqueue_style('vi-theme', get_stylesheet_uri(), array(), null);
}
// frontend script & style
function vi_theme_frontend_scripts() {
// wp_enqueue_style( $handle, $src, $deps, $ver, $media )
vi_theme_styles();
// wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer )
wp_enqueue_script('vi-theme', get_template_directory_uri() .'/js/custom.js', array('jquery'), null, true);
}
add_action('wp_enqueue_scripts', 'vi_theme_frontend_scripts');
// register nav menus
function register_menu() {
register_nav_menu('primary-menu',__( 'Primary Menu' ));
}
add_action( 'init', 'register_menu' );
// including generated code for custom fields
include_once( get_stylesheet_directory() . '/inc/custom-fields.php');