-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
executable file
·124 lines (96 loc) · 3.35 KB
/
functions.php
File metadata and controls
executable file
·124 lines (96 loc) · 3.35 KB
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
<?php
/**
* Functions
* /
/ *
* This setup function attaches all of the site-wide functions
* to the correct hooks and filters. All the functions themselves
* are defined below this setup function.
*/
add_action('genesis_setup','child_theme_setup', 15);
function child_theme_setup() {
define( 'CHILD_THEME_VERSION', filemtime( get_stylesheet_directory() . '/style.css' ) );
define( 'CHILD_THEME_NAME', 'center' );
// ** Backend **
// Image Sizes
// add_image_size( 'center_featured', 400, 100, true );
//html5
add_theme_support( 'html5');
// Structural Wraps
add_theme_support( 'genesis-structural-wraps', array( 'header', 'nav', 'subnav', 'inner', 'footer-widgets', 'footer' ) );
// Menus
add_theme_support( 'genesis-menus', array( 'primary' => 'Primary Navigation Menu' ) );
// Add support for custom header
add_theme_support( 'custom-header', array(
'width' => 600,
'height' => 128,
'header-selector' => '.site-title a',
'header-text' => false,
'flex-height' => true,
) );
// Add support for custom background
add_theme_support( 'custom-background', array(
'default-color' => 'f5f5f5',
'default-image' => get_stylesheet_directory_uri().'/images/body.png'
) );
//Footer Widget
add_theme_support( 'genesis-footer-widgets', 2);
// Adding Color Style Options
add_theme_support( 'genesis-style-selector', array(
'center-dark' => __( 'Dark', 'center' )
) );
// Sidebars
unregister_sidebar( 'sidebar-alt' );
unregister_sidebar( 'sidebar' );
genesis_register_sidebar( array(
'id' => 'home-top',
'name' => __( 'Home Top', 'CHILD_THEME_NAME' ),
'description' => __( 'This is the home top widget area.', 'CHILD_THEME_NAME' ),
) );
// Remove Unused Page Layouts
genesis_unregister_layout( 'content-sidebar-sidebar' );
genesis_unregister_layout( 'sidebar-sidebar-content' );
genesis_unregister_layout( 'sidebar-content-sidebar' );
genesis_unregister_layout( 'sidebar-content' );
genesis_unregister_layout( 'content-sidebar' );
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
// Editor Styles
add_editor_style( 'editor-style.css' );
// Don't update theme
add_filter( 'http_request_args', 'center_dont_update_theme', 5, 2 );
// Better looking post meta in header
add_filter( 'genesis_post_info', 'anahita_post_info');
} //end theme setup
// ** Backend Functions ** //
/**
* Don't Update Theme
* @since 1.0.0
*
* If there is a theme in the repo with the same name,
* this prevents WP from prompting an update.
*
* @author Mark Jaquith
* @link http://markjaquith.wordpress.com/2009/12/14/excluding-your-plugin-or-theme-from-update-checks/
*
* @param array $r, request arguments
* @param string $url, request url
* @return array request arguments
*/
function center_dont_update_theme( $r, $url ) {
if ( 0 !== strpos( $url, 'http://api.wordpress.org/themes/update-check' ) )
return $r; // Not a theme update request. Bail immediately.
$themes = unserialize( $r['body']['themes'] );
unset( $themes[ get_option( 'template' ) ] );
unset( $themes[ get_option( 'stylesheet' ) ] );
$r['body']['themes'] = serialize( $themes );
return $r;
}
/**
* Better looking post_info
* @since 1.1.0
*
*/
function anahita_post_info($filtered) {
$filtered = '[post_author_posts_link] [post_date format="M d, Y"] [post_comments] [post_edit]';
return $filtered;
}