-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
54 lines (47 loc) · 1.61 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 ( ! function_exists( 'theme_env_sample_setup' ) ) :
function theme_env_sample_setup() {
load_theme_textdomain( 'theme-env-sample', get_template_directory() . '/languages' );
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'title-tag' );
add_theme_support( 'post-thumbnails' );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => esc_html__( 'Primary', 'theme_env_sample' ),
) );
add_theme_support( 'html5', array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
) );
add_theme_support( 'post-formats', array(
'aside',
'image',
'video',
'quote',
'link',
) );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'theme_env_sample_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
}
endif;
add_action( 'after_setup_theme', 'theme_env_sample_setup' );
function theme_env_sample_content_width() {
$GLOBALS['content_width'] = apply_filters( 'theme_env_sample_content_width', 640 );
}
add_action( 'after_setup_theme', 'theme_env_sample_content_width', 0 );
/**
* Enqueue scripts and styles.
*/
function theme_env_sample_scripts() {
$theme = wp_get_theme();
$theme_version = $theme->get( 'Version' );
wp_enqueue_style( 'theme-env-sample-style', get_stylesheet_uri(), array(), $theme_version );
wp_enqueue_script( 'theme-env-sample-script', get_template_directory_uri() . '/bundle.js', array( 'jquery' ), $theme_version, true );
}
add_action( 'wp_enqueue_scripts', 'theme_env_sample_scripts' );