-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
75 lines (60 loc) · 2.29 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
<?php
// Add RSS links to <head> section
automatic_feed_links();
// Load jQuery
if ( !is_admin() ) {
wp_deregister_script('jquery');
wp_register_script('jquery', ("https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"), false);
wp_enqueue_script('jquery');
}
// register Custom Sidbear ... use get_sidebar() to display
if (function_exists('register_sidebar')) {
register_sidebar(array(
'name' => 'Sidebar Widgets',
'id' => 'sidebar-widgets',
'description' => 'These is widgets for the sidebar.',
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h2>',
'after_title' => '</h2>'
));
}
// register Footbar ... use dynamic_sidebar('Footbar') to display
if (function_exists('register_sidebar')) {
register_sidebar(array(
'name' => 'Footer Widgets',
'id' => 'footbar',
'description' => 'These are widgets for the sidebar.',
'before_widget' => '<div id="%1$s" class="widget footbar">',
'after_widget' => '</div>',
'before_title' => '<h2>',
'after_title' => '</h2>'
));
}
if ( function_exists( 'add_theme_support' ) ) {
add_theme_support( 'post-thumbnails' );
}
// custom excerpt length
function custom_excerpt_length( $length ) {
return 75;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
// change what is said at the end of the excerpt
function new_excerpt_more($more) {
global $post;
return ' <a href="'. get_permalink($post->ID) . '">Read more...</a>';
}
add_filter('excerpt_more', 'new_excerpt_more');
//no p tags around images
function filter_ptags_on_images($content){
return preg_replace('/<p>\s*(<a .*>)?\s*(<img .* \/>)\s*(<\/a>)?\s*<\/p>/iU', '\1\2\3', $content);
}
add_filter('the_content', 'filter_ptags_on_images');
// add ie conditional html5 shim to header
function add_ie_html5_shim () {
echo '<!--[if lt IE 9]>';
echo '<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>';
echo '<![endif]-->';
}
add_action('wp_head', 'add_ie_html5_shim');
?>