-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfunctions.php
executable file
·108 lines (95 loc) · 2.89 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
<?php
/**
* This is child themes functions.php file. All modifications should be made in this file.
*
* All style changes should be in child themes style.css file.
*
* @package Polymer
* @version 0.3
* @author Gaurav Pareek <grv@magikpress.com>
* @copyright Copyright (c) 2014, Gaurav Pareek
* @author Ruairi Phelan <rory@cyberdesigncraft.com>
* @copyright Copyright (c) 2013, Ruairi Phelan
* @author Justin Tadlock <justin@justintadlock.com>
* @copyright Copyright (c) 2013, Justin Tadlock
* @link http://magikpress.com/themes/polymer
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/
/* Adds the child theme setup function to the 'after_setup_theme' hook. */
add_action( 'after_setup_theme', 'polymer_theme_setup', 11 );
add_action( 'after_setup_theme', 'polymer_unregister_default_headers', 16 );
include_once('inc/colors.php');
/**
* Setup function. All child themes should run their setup within this function. The idea is to add/remove
* filters and actions after the parent theme has been set up. This function provides you that opportunity.
*
* @since 0.1
* @access public
* @return void
*/
function polymer_theme_setup() {
/* Change default background color. */
add_theme_support(
'custom-header',
array(
'default-image' => '',
'default-text-color' => '272727',
'default-image' => get_stylesheet_directory_uri() . '/images/headers/material1.jpg'
));
add_theme_support(
'custom-background',
array(
'default-color' => 'eeeeee',
'default-image' => '',
));
/*
* Registers default headers for the child theme.
* @since 0.1.0
* @link http://codex.wordpress.org/Function_Reference/register_default_headers
*/
register_default_headers(
array(
'material1' => array(
'url' => '%2$s/images/headers/material1.jpg',
'thumbnail_url' => '%2$s/images/headers/material1-thumb.jpg',
/* Translators: Header image description. */
'description' => __( 'Material1', 'polymer' )
)
)
);
/* Change primary color. */
add_filter( 'theme_mod_color_primary', 'polymer_primary_color' );
/* Add custom stylesheets. */
add_action( 'wp_enqueue_scripts', 'polymer_enqueue_styles' );
}
function polymer_unregister_default_headers() {
/**
* Un-Register default Parent Theme headers for the child theme.
* @since 0.1
*/
unregister_default_headers(
array( 'horizon', 'orange-burn', 'planets-blue', 'planet-burst', 'space-splatters' )
);
}
/**
* Change primary color
*
* @since 0.1
* @access public
* @param string $hex
* @return string
*/
function polymer_primary_color( $color ) {
return $color ? $color : '349F8C';
}
/**
* Loads custom stylesheets for the theme.
*
* @since 0.1
* @access public
* @return void
*/
function polymer_enqueue_styles() {
wp_register_style('googleFonts', '//fonts.googleapis.com/css?family=Roboto+Condensed:400,300,700,400italic');
wp_enqueue_style( 'googleFonts');
}