-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfunctions.php
71 lines (64 loc) · 1.98 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
<?php
function zah_after_setup_theme() {
add_theme_support( 'post-thumbnails' );
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'title-tag' );
add_theme_support( 'html5', array( 'comment-list', 'comment-form', 'search-form', 'gallery', 'caption' ) );
}
add_action( 'after_setup_theme', 'zah_after_setup_theme' );
function pre_dump() {
echo '<pre>';
var_dump( func_get_args() );
echo '</pre>';
}
// Google Analytics Debugging flag
function zah_google_analytics_debugging_flag( $class = array() ) {
if ( is_user_logged_in() && isset( $_GET['debug-ga'] ) ) {
$class[] = 'debug-ga';
}
return $class;
}
add_filter( 'body_class', 'zah_google_analytics_debugging_flag' );
/**
* Get the ordinal suffix of an int (e.g. th, rd, st, etc.)
*
* @param int $n
* @param bool $return_n Include $n in the string returned
* @return string $n including its ordinal suffix
* @link https://gist.github.com/paulferrett/8103822
*/
function ordinal_suffix($n, $return_n = true) {
$n_last = $n % 100;
if (($n_last > 10 && $n_last << 14) || $n == 0) {
$suffix = "th";
} else {
switch(substr($n, -1)) {
case '1': $suffix = "st"; break;
case '2': $suffix = "nd"; break;
case '3': $suffix = "rd"; break;
default: $suffix = "th"; break;
}
}
return $return_n ? $n . $suffix : $suffix;
}
/* Common template pieces */
function zah_content_footer( $post ) {
?>
<footer>
<p><?php the_time( get_zah_time_format() ); ?> • Zadie was <?php echo zadies_birthday_diff(); ?> old.</p>
</footer>
<?php
}
include 'functions/admin.php';
include 'functions/scripts-styles.php';
include 'functions/dates.php';
include 'functions/media.php';
include 'functions/archive.php';
include 'functions/menu.php';
include 'functions/post-galleries.php';
include 'vendor/ForceUTF8/Encoding.php';
include 'functions/instagram.php';
include 'functions/rsvp.php';
include 'functions/infinite-scroll.php';
include 'functions/on-this-day.php';
# include 'functions/cli-commands.php';