-
-
Notifications
You must be signed in to change notification settings - Fork 54
/
functions.php
72 lines (60 loc) · 3.6 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
<?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 = 900;
/*-----------------------------------------------------------------------------------*/
/* Add Rss feed support to Head section
/*-----------------------------------------------------------------------------------*/
add_theme_support( 'automatic-feed-links' );
/*-----------------------------------------------------------------------------------*/
/* Add post thumbnail/featured image support
/*-----------------------------------------------------------------------------------*/
add_theme_support( 'post-thumbnails' );
/*-----------------------------------------------------------------------------------*/
/* Register main menu for Wordpress use
/*-----------------------------------------------------------------------------------*/
register_nav_menus(
array(
'primary' => __( 'Primary Menu', 'naked' ), // Register the Primary menu
// Copy and paste the line above right here if you want to make another menu,
// just change the 'primary' to another name
)
);
/*-----------------------------------------------------------------------------------*/
/* 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' => 'Take it on the side...', // Dumb 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
// Copy and paste the lines above right here if you want to make another sidebar,
// just change the values of id and name to another word/name
));
}
// 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', get_template_directory_uri() . '/js/theme.min.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