-
Notifications
You must be signed in to change notification settings - Fork 3
/
functions.php
97 lines (78 loc) · 2.35 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
<?php
/**
* @package Ex Astris
* @version 1.0.0
* @author Sarah Gooding <keepingcozy@gmail.com>
* @copyright Copyright (c) 2014, Sarah Gooding
* @link http://themehybrid.com/themes/ex-astris
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/
/* Add the child theme setup function to the 'after_setup_theme' hook. */
add_action( 'after_setup_theme', 'ex_astris_theme_setup' );
/**
* @since 1.0.0
* @access public
* @return void
*/
function ex_astris_theme_setup() {
/*
* Add a custom background to overwrite the defaults. Remove this section if you want to use
* the parent theme defaults instead.
*
* @link http://codex.wordpress.org/Custom_Backgrounds
*/
add_theme_support(
'custom-background',
array(
'default-color' => '2d2d2d',
'default-image' => '%2$s/images/backgrounds/mountain.jpg',
'default-repeat' => 'no-repeat',
'default-position' => 'center',
'default-position-x' => 'center',
'default-attachment' => 'fixed',
)
);
/* Add suport for custom header but show none by default. */
add_theme_support( 'custom-header', array( 'default-image' => '' ) );
/* Filter to add custom default backgrounds (supported by the framework). */
add_filter( 'hybrid_default_backgrounds', 'ex_astris_default_backgrounds' );
/* Add a custom default color for the "primary" color option. */
add_filter( 'theme_mod_color_primary', 'ex_astris_color_primary' );
/* Add custom stylesheets. */
add_action( 'wp_enqueue_scripts', 'ex_astris_enqueue_styles' );
}
/**
* @since 1.0.0
* @access public
* @param array $backgrounds
* @return array
*/
function ex_astris_default_backgrounds( $backgrounds ) {
$new_backgrounds = array(
'green' => array(
'url' => '%2$s/images/backgrounds/mountain.jpg',
'thumbnail_url' => '%2$s/images/backgrounds/mountain-thumb.jpg',
),
);
return array_merge( $new_backgrounds, $backgrounds );
}
/**
* @since 1.0.0
* @access public
* @param string $hex
* @return string
*/
function ex_astris_color_primary( $hex ) {
return $hex ? $hex : '111111';
}
/**
* Loads custom stylesheets for the theme.
*
* @since 1.0.0
* @access public
* @return void
*/
function ex_astris_enqueue_styles() {
wp_register_style('googleFonts', '//fonts.googleapis.com/css?family=Copse');
wp_enqueue_style( 'googleFonts');
}