-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfunctions.php
95 lines (68 loc) · 2.18 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
<?php /*
================================================================================
CommentPress Default Child Theme Functions
================================================================================
AUTHOR: Christian Wach <[email protected]>
--------------------------------------------------------------------------------
NOTES
Example theme amendments and overrides.
--------------------------------------------------------------------------------
*/
/**
* Set the content width based on the theme's design and stylesheet.
*
* This seems to be a WordPress requirement - though rather dumb in the context
* of our theme, which has a percentage-based default width.
*
* I have arbitrarily set it to the default content-width when viewing on a
* 1280px-wide screen.
*/
if ( !isset( $content_width ) ) { $content_width = 588; }
/**
* Augment the CommentPress Default Theme setup function.
*
* @since 3.4
*/
function commentpress_default_child_setup() {
/**
* Make theme available for translation.
*
* Translations can be added to the /languages directory of the child theme.
*/
load_theme_textdomain(
'commentpress-default-child',
get_stylesheet_directory() . '/languages'
);
}
// add after theme setup hook
add_action( 'after_setup_theme', 'commentpress_default_child_setup' );
/**
* Override styles by enqueueing as late as we can.
*
* @since 3.4
*/
function commentpress_default_child_enqueue_styles() {
// add child theme's css file
wp_enqueue_style(
'cpchild_css',
get_stylesheet_directory_uri() . '/assets/css/style-overrides.css',
array( 'cp_layout_css' ),
'1.0', // version
'all' // media
);
}
// add a filter for the above
add_filter( 'wp_enqueue_scripts', 'commentpress_default_child_enqueue_styles', 110 );
/**
* Override default sidebar column order.
*
* @since 3.4
*/
function commentpress_default_child_sidebar_tab_order( $order ) {
// ignore what's sent to us and set our own order here
$order = array( 'comments', 'activity', 'contents' );
// --<
return $order;
}
// uncomment the line below to enable the order defined above
//add_filter( 'cp_sidebar_tab_order', 'commentpress_default_child_sidebar_tab_order', 21, 1 );