-
Notifications
You must be signed in to change notification settings - Fork 18
/
functions.php
126 lines (116 loc) · 2.53 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
115
116
117
118
119
120
121
122
123
124
125
126
<?php
/**
* Bathe functions
*
* @package Bathe
*/
/**
* Set up theme defaults and registers support for various WordPress feaures.
*/
add_action(
'after_setup_theme',
function () {
load_theme_textdomain( 'bathe', get_theme_file_uri( 'languages' ) );
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'title-tag' );
add_theme_support( 'post-thumbnails' );
add_theme_support(
'html5',
array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
)
);
add_theme_support(
'post-formats',
array(
'aside',
'image',
'video',
'quote',
'link',
)
);
add_theme_support(
'custom-background',
apply_filters(
'bathe_custom_background_args',
array(
'default-color' => 'ffffff',
'default-image' => '',
)
)
);
// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
/**
* Add support for core custom logo.
*
* @link https://codex.wordpress.org/Theme_Logo
*/
add_theme_support(
'custom-logo',
array(
'height' => 200,
'width' => 50,
'flex-width' => true,
'flex-height' => true,
)
);
register_nav_menus(
array(
'primary' => __( 'Primary Menu', 'bathe' ),
)
);
}
);
/**
* Set the content width in pixels, based on the theme's design and stylesheet.
*
* Priority 0 to make it available to lower priority callbacks.
*
* @global int $content_width
*/
add_action(
'after_setup_theme',
function () {
$GLOBALS['content_width'] = apply_filters( 'bathe_content_width', 960 );
},
0
);
/**
* Register widget area.
*/
add_action(
'widgets_init',
function () {
register_sidebar(
array(
'name' => __( 'Sidebar', 'bathe' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
}
);
/**
* Enqueue scripts and styles.
*/
add_action(
'wp_enqueue_scripts',
function () {
wp_enqueue_style( 'bathe', get_theme_file_uri( 'assets/css/main.css' ), array(), '3.0.1' );
wp_enqueue_style( 'tailwind', get_theme_file_uri( 'assets/css/tailwind.css' ), array(), '3.3.2' );
wp_enqueue_script( 'bathe', get_theme_file_uri( 'assets/js/main.js' ), array(), '3.0.1', true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
);