-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
43 lines (37 loc) · 1002 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
38
39
40
41
42
43
<?php
/*
* Registers the theme's menus.
*/
function register_my_menus() {
register_nav_menus ( array (
'navigation_menu_location' => __ ( 'Navigation menu location' )
) );
}
add_action ( 'init', 'register_my_menus' );
/*
* Enables support for custom header images.
*/
function enable_custom_header() {
add_theme_support ( 'custom-header', array (
'default-image' => get_template_directory_uri () . 'images/default-image',
'default-text-color' => '000',
'flex-width' => true,
'flex-height' => true
) );
}
add_action ( 'after_setup_theme', 'enable_custom_header' );
/*
* Enables support for featured images.
*/
function enable_featured_images() {
add_theme_support ( 'post-thumbnails' );
}
add_action ( 'after_setup_theme', 'enable_featured_images' );
/*
* Removes width and height attributes from images.
*/
function remove_img_attr($html) {
return preg_replace ( '/(width|height)="\d+"\s/', "", $html );
}
add_filter ( 'post_thumbnail_html', 'remove_img_attr' );
?>