-
Notifications
You must be signed in to change notification settings - Fork 25
/
functions.php
100 lines (79 loc) · 2.39 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
<?php
/**
* Theme functions
*
* Sets up the theme and provides some helper functions.
*
* @package themeHandle
*/
/* OEMBED SIZING
========================== */
if ( ! isset( $content_width ) )
$content_width = 600;
/* THEME SETUP
========================== */
if ( ! function_exists( 'themeFunction_setup' ) ):
function themeFunction_setup() {
// Available for translation
load_theme_textdomain( 'themeTextDomain', get_template_directory() . '/languages' );
// Add default posts and comments RSS feed links to <head>.
add_theme_support( 'automatic-feed-links' );
// Add custom nav menu support
register_nav_menu( 'primary', __( 'Primary Menu', 'themeTextDomain' ) );
// Add featured image support
add_theme_support( 'post-thumbnails' );
// Enable support for HTML5 markup.
add_theme_support( 'html5', array(
'comment-list',
'search-form',
'comment-form',
'gallery',
) );
// Add custom image sizes
// add_image_size( 'name', 500, 300 );
}
endif;
add_action( 'after_setup_theme', 'themeFunction_setup' );
/* SIDEBARS & WIDGET AREAS
========================== */
function themeFunction_widgets_init() {
register_sidebar( array(
'name' => __( 'Sidebar', 'themeTextDomain' ),
'id' => 'sidebar-1',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => "</aside>",
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
}
add_action( 'widgets_init', 'themeFunction_widgets_init' );
/* ENQUEUE SCRIPTS & STYLES
========================== */
function themeFunction_scripts() {
// theme style.css file
wp_enqueue_style( 'themeTextDomain-style', get_stylesheet_uri() );
// threaded comments
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
// vendor scripts
// wp_enqueue_script(
// 'vendor',
// get_template_directory_uri() . '/assets/vendor/newscript.js',
// array('jquery')
// );
// theme scripts
// wp_enqueue_script(
// 'theme-init',
// get_template_directory_uri() . '/assets/theme.js',
// array('jquery')
// );
}
add_action('wp_enqueue_scripts', 'themeFunction_scripts');
/* MISC EXTRAS
========================== */
// Comments & pingbacks display template
include('inc/functions/comments.php');
// Optional Customizations
// Includes: TinyMCE tweaks, admin menu & bar settings, query overrides
include('inc/functions/customizations.php');