-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
91 lines (83 loc) · 2.55 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
<?php
/**
* Functions for theme Hello-Theme
* Sets up theme defaults and registers support for various WordPress features.
*
* @package WordPress
* @package ClassicPress
* @subpackage Hello Theme
* @since 1.0.1
*
*/
if ( ! defined( 'ABSPATH' ) ) {
exit( 'Direct script access denied.' );
}
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*
* Create your own hello_theme_child_setup() function to override in a child theme.
*
* When using a child theme you can override certain functions (those wrapped
* in a function_exists() call) by defining them first in your child theme's
* functions.php file. The child theme's functions.php file is included before
* the parent theme's file, so the child theme functions would be used.
*
* @link https://codex.wordpress.org/Theme_Development
* @link https://codex.wordpress.org/Child_Themes
*
* @since Hello Theme 1.0
*/
if ( ! function_exists( 'hello_theme_theme_setup' ) ) :
function hello_theme_theme_setup() {
/**
* Not used in ClassicPress < 2.0
* to output valid HTML5.
*/
if ( function_exists( 'is_classicpress' ) && version_compare( '2.0', $cp_version, '<' ) ) {
add_theme_support( 'html5', array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
));
}
/**
* Make theme available for translation.
* Translations can be added to the /languages/ directory.
*/
load_theme_textdomain( 'hello-theme', get_template_directory_uri() . '/languages' );
}
add_action( 'after_setup_theme', 'hello_theme_theme_setup' );
endif
/**
* `wp_body_open` Tag may or may not be needed but accommodate for it.
*
* @since 1.0
*/
if ( ! function_exists( 'wp_body_open' ) ) {
/**
* Add backwards compatibility support for wp_body_open function.
*/
function wp_body_open() {
do_action( 'wp_body_open' );
}
}
/**
* Sets 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
*
* @since 1.0
*/
function hello_theme_theme_content_width()
{
$GLOBALS['content_width'] = apply_filters( 'hello_theme_content_width', 680 );
}
add_action( 'after_setup_theme', 'hello_theme_theme_content_width', 0 );