-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
114 lines (95 loc) · 4.34 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?php
/*-----------------------------------------------------------------------------------*/
/* This file will be referenced every time a template/page loads on your Wordpress site
/* This is the place to define custom fxns and specialty code
/*-----------------------------------------------------------------------------------*/
// Define the version so we can easily replace it throughout the theme
define( 'NAKED_VERSION', 1.0 );
// Set the maximum allowed width for any content in the theme
if ( ! isset( $content_width ) ) $content_width = 1160;
// Add Rss feed support to Head section
add_theme_support( 'automatic-feed-links' );
// Add navwalker support to Head section
require ( 'walker/WordpressUikitMenuWalker.php' );
// Add post thumbnail/featured image support
add_theme_support( 'post-thumbnails' );
/*-----------------------------------------------------------------------------------*/
/* Register main menu for Wordpress use
/*-----------------------------------------------------------------------------------*/
register_nav_menus(
array(
'main' => __( 'Main Menu', 'naked' ), // Register the Primary menu
'mobile' => __( 'Mobile Menu', 'naked' ), // Register the Mobile menu
'footer' => __( 'Footer Menu', 'naked' ) // Register the Footer menu
)
);
/*-----------------------------------------------------------------------------------*/
/* Activate sidebar for Wordpress use
/*-----------------------------------------------------------------------------------*/
function naked_register_sidebars() {
register_sidebar(array( // Start a series of sidebars to register
'id' => 'sidebar', // Make an ID
'name' => 'Sidebar', // Name it
'description' => 'Admin', // Description for the admin side
'before_widget' => '<div>', // What to display before each widget
'after_widget' => '</div>', // What to display following each widget
'before_title' => '<h3 class="side-title">', // What to display before each widget's title
'after_title' => '</h3>', // What to display following each widget's title
'empty_title'=> '' // What to display in the case of no title defined for a widget
));
register_sidebar(array(
'id' => 'first-footer-widget',
'name' => 'Footer One',
'description' => 'Admin',
'before_widget' => '<div>',
'after_widget' => '</div>',
'before_title' => '<h3 class="side-title">',
'after_title' => '</h3>',
'empty_title'=> ''
));
register_sidebar(array(
'id' => 'second-footer-widget',
'name' => 'Footer Two',
'description' => 'Admin',
'before_widget' => '<div>',
'after_widget' => '</div>',
'before_title' => '<h3 class="side-title">',
'after_title' => '</h3>',
'empty_title'=> ''
));
register_sidebar(array(
'id' => 'third-footer-widget',
'name' => 'Footer Three',
'description' => 'Admin',
'before_widget' => '<div>',
'after_widget' => '</div>',
'before_title' => '<h3 class="side-title">',
'after_title' => '</h3>',
'empty_title'=> ''
));
register_sidebar(array(
'id' => 'fourth-footer-widget',
'name' => 'Footer Four',
'description' => 'Admin',
'before_widget' => '<div>',
'after_widget' => '</div>',
'before_title' => '<h3 class="side-title">',
'after_title' => '</h3>',
'empty_title'=> ''
));
}
// adding sidebars to Wordpress (these are created in functions.php)
add_action( 'widgets_init', 'naked_register_sidebars' );
/*-----------------------------------------------------------------------------------*/
/* Enqueue Styles and Scripts
/*-----------------------------------------------------------------------------------*/
function naked_scripts() {
// get the theme directory style.css and link to it in the header
wp_enqueue_style('style.css', get_stylesheet_directory_uri() . '/style.css');
// add fitvid
wp_enqueue_script( 'naked-fitvid', get_template_directory_uri() . '/js/jquery.fitvids.js', array( 'jquery' ), NAKED_VERSION, true );
// add theme scripts
wp_enqueue_script( 'naked-uikit', get_template_directory_uri() . '/js/uikit.js', array(), NAKED_VERSION, true );
wp_enqueue_script( 'naked', get_template_directory_uri() . '/js/theme.js', array(), NAKED_VERSION, true );
}
add_action( 'wp_enqueue_scripts', 'naked_scripts' ); // Register this fxn and allow Wordpress to call it automatcally in the header