/
functions.php
127 lines (90 loc) · 4.5 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<?php
/**
* Starkers functions and definitions
*
* For more information on hooks, actions, and filters, see http://codex.wordpress.org/Plugin_API.
*
* @package WordPress
* @subpackage Starkers
* @since Starkers 4.0
*/
/* ========================================================================================================================
Required external files
======================================================================================================================== */
require_once( 'external/starkers-utilities.php' );
/* ========================================================================================================================
Theme specific settings
Uncomment register_nav_menus to enable a single menu with the title of "Primary Navigation" in your theme
======================================================================================================================== */
add_theme_support('post-thumbnails');
// register_nav_menus(array('primary' => 'Primary Navigation'));
/* ========================================================================================================================
Actions and Filters
======================================================================================================================== */
add_action( 'wp_enqueue_scripts', 'starkers_script_enqueuer' );
add_filter( 'body_class', array( 'Starkers_Utilities', 'add_slug_to_body_class' ) );
/* ========================================================================================================================
Custom Post Types - include custom post types and taxonimies here e.g.
e.g. require_once( 'custom-post-types/your-custom-post-type.php' );
======================================================================================================================== */
/* ========================================================================================================================
Scripts
======================================================================================================================== */
/**
* Add scripts via wp_head()
*
* @return void
* @author Keir Whitaker
*/
function starkers_script_enqueuer() {
//wp_register_script('modernizr', get_stylesheet_directory_uri().'/js/vendor/modernizr.min.js',false,null);
//wp_enqueue_script('modernizr');
// wp_register_style('google_typeface', '//fonts.googleapis.com/css?family=Shadows+Into+Light|PT+Sans|Ubuntu|Open+Sans:400,700,400italic,700italic', '', '', 'all');
// wp_enqueue_style( 'google_typeface' );
}
/* ========================================================================================================================
Comments
======================================================================================================================== */
/**
* Custom callback for outputting comments
*
* @return void
* @author Keir Whitaker
*/
function starkers_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
?>
<?php if ( $comment->comment_approved == '1' ): ?>
<li <?php comment_class(); ?>>
<div id="comment-<?php comment_ID() ?>">
<div class="avatar">
<?php echo get_avatar( $comment, 80 ); ?>
</div>
<div class="commentbody">
<div class="vcard">
<div class="commentauthor"><?php comment_author_link() ?></div>
<div class="commentmetadata">
<time><a href="#comment-<?php comment_ID() ?>" pubdate><?php comment_date('F j, Y') ?></a></time>
</div>
</div>
<div class="commentcontent">
<?php comment_text() ?>
</div>
<?php comment_reply_link(array_merge( $args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
</div>
</div>
<?php global $user_ID; if( $user_ID ) : if(current_user_can('level_10')) : ?>
<div class="comment-controls">
<?php comment_reply_link(get_comment_ID()); ?>
<?php m9s_comment_control_links(get_comment_ID()); ?>
</div>
<?php endif; endif;?>
<?php endif;
}
/* =========================================================================================================================
Custom Stuff
========================================================================================================================== */
## bio
if(false === ($value = get_transient('bio-ftlinks'))){
set_transient('bio-ftlinks', get_the_author_meta('description', 2), WEEK_IN_SECONDS * 2 );
}