-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
37 lines (30 loc) · 867 Bytes
/
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
<?
add_filter('show_admin_bar', '__return_false');
add_theme_support('post-thumbnails');
/* UTILITY FUNCTIONS */
function get_template_name($id) {
return str_replace('.php', '', get_post_meta($id, '_wp_page_template', true));
}
function get_thumbnail_src($id = null, $size = 'full') {
global $post;
if(!$id) {
$id = $post->ID;
}
return get_attachment_src(get_post_thumbnail_id($id), $size);
}
function get_attachment_src($id = null, $size = 'full') {
$img = wp_get_attachment_image_src($id, $size);
return $img[0];
}
function get_video_embed($url) {
return '<div class="video">'.strip_tags(apply_filters('the_content', $url), '<iframe><video><embed><object>').'</div>';
}
/* DEVELOPMENT FUNCTIONS */
function debug() {
echo '<pre>';
foreach(func_get_args() as $arg) {
print_r($arg);
}
echo '</pre>';
}
?>