-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
executable file
·131 lines (102 loc) · 2.55 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
128
129
130
131
<?php
/* ---- Custom Post Types and Taxonomies ---- */
/*
function register_post_types(){
register_post_type( 'books',
array(
'labels' => array(
'name' => __( 'Books' ),
'singular_name' => __( 'Books' )
),
'public' => true,
'has_archive' => true,
'supports' => array('title', 'editor', 'thumbnail')
)
);
}
function register_taxonomies(){
register_taxonomy('genre', array('books'),
array(
'labels' => array(
'name' => __( 'Genres' ),
'singular_name' => __( 'Genre' )
),
'hierarchical' => true,
'show_ui' => true,
'query_var' => true
)
);
}
add_action( 'init', 'register_post_types', 0 );
add_action( 'init', 'register_taxonomies', 0 );
*/
/* ---- Post Thumbnails ---- */
/*
add_theme_support('post-thumbnails', array('post','case_studies'));
set_post_thumbnail_size( 208, 127, true );
add_image_size("case-study", 450, 270, true);
*/
/* ---- Sidebar ---- */
/*
if ( function_exists('register_sidebar') ){
register_sidebar(array(
'name' => 'sidebar1',
'before_widget' => '<div class="widget">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
}
*/
/* ---- Styles ---- */
function enqueue_styles(){
wp_enqueue_style('main', get_bloginfo('template_url') . '/css/main.css');
}
add_action('init', 'enqueue_styles');
/* ---- Scripts ---- */
function enqueue_scripts(){
wp_enqueue_script(
"modernizr",
get_template_directory_uri()."/js/libs/modernizr.min.js",
null,
null,
false
);
wp_enqueue_script(
"jquery",
get_template_directory_uri()."/js/libs/jquery-1.9.1.min.js", //(fallback)
null,
null,
true
);
wp_enqueue_script(
"plugins",
get_template_directory_uri()."/js/plugins.js",
null,
null,
true
);
wp_enqueue_script(
"scripts",
get_template_directory_uri()."/js/scripts.js",
null,
null,
true
);
}
add_action('init', 'enqueue_scripts');
/* ---- Other ---- */
//add excerpt field into pages
add_post_type_support( 'page', 'excerpt' );
//add custom menu support
add_action('init', 'register_custom_menu');
function register_custom_menu() {
register_nav_menu('custom_menu', __('Custom Menu'));
}
//replacement text for 'read more' after excerpts
function new_excerpt_more($more) {
global $post;
return ' <a class="moretag" href="'. get_permalink($post->ID) . '">Read more</a>';
}
add_filter('excerpt_more', 'new_excerpt_more');
?>