-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
48 lines (44 loc) · 1.28 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
<?php
/**
* Andrew Spittle functions and definitions
*
* @package Andrew Spittle
* @since Andrew Spittle 1.0
*/
if ( ! function_exists( 'andrewspittle_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which runs
* before the init hook. The init hook is too late for some features, such as indicating
* support post thumbnails.
*
* @since Andrew Spittle 1.0
*/
function andrewspittle_setup() {
/**
* Register custom image size for book covers
*/
add_image_size( 'book-cover', 9999, 250 ); //200 pixels wide, 150 pixels tall, cropped
}
endif; // andrewspittle_setup
add_action( 'after_setup_theme', 'andrewspittle_setup' );
/**
* Enqueue scripts and styles
*/
function andrewspittle_scripts() {
wp_enqueue_style( 'style', get_stylesheet_uri(), '', '20130505-1' );
}
add_action( 'wp_enqueue_scripts', 'andrewspittle_scripts' );
if ( ! function_exists( 'andrewspittle_posted_on' ) ) :
/**
* Custom posted_on function to include on single book pages.
*/
function andrewspittle_posted_on() {
printf( __( '<time class="entry-date" datetime="%1$s" pubdate>%2$s</time>', 'andrewspittle' ),
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() )
);
}
endif;
?>