Project

General

Profile

Feature #4390 » custom-functions.php

Stephen Klein, 2015-08-31 03:12 PM

 
1
<?php // ADD HEADER WIDGET //
2

    
3

    
4

    
5
if (function_exists('register_sidebar')) {
6

    
7
register_sidebar(array(
8

    
9
'name' => 'Header Widget',
10

    
11
'id' => 'header-widget',
12

    
13
'description' => 'Library hours.',
14

    
15
'before_widget' => '<div id="%1$s" class="widget %2$s">',
16

    
17
'after_widget' => '</div>',
18

    
19
'before_title' => '<h2>',
20

    
21
'after_title' => '</h2>'
22

    
23
));
24

    
25
}
26

    
27

    
28

    
29
if ( function_exists( 'add_image_size' ) ) { 
30

    
31
	add_image_size( 'slider', 574, 225, true ); //(cropped)
32

    
33
}
34

    
35

    
36

    
37
add_filter( 'image_size_names_choose', 'my_custom_sizes' );
38

    
39

    
40

    
41
function my_custom_sizes( $sizes ) {
42

    
43
    return array_merge( $sizes, array(
44

    
45
        'your-custom-size' => __('slider'),
46

    
47
    ) );
48

    
49
}
50

    
51

    
52

    
53
function custom_themify_extend_image_sizes( $sizes ) {
54

    
55
$sizes['slider'] = __( 'Slider', 'themify' );
56

    
57
return $sizes;
58

    
59
}
60

    
61

    
62

    
63
add_filter( 'image_size_names_choose', 'custom_themify_extend_image_sizes' );
64

    
65

    
66

    
67

    
68

    
69

    
70

    
71

    
72

    
73

    
74

    
75
//Adding the Open Graph in the Language Attributes
76
function add_opengraph_doctype( $output ) {
77
		return $output . ' xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml"';
78
	}
79
add_filter('language_attributes', 'add_opengraph_doctype');
80

    
81
//Lets add Open Graph Meta Info
82

    
83

    
84
add_action( 'wp_head', 'insert_fb_in_head', 5 );
85

    
86
add_filter( 'wp_feed_cache_transient_lifetime', 
87
   create_function('$a', 'return 100;') );
88

    
89

    
90

    
91
?>
(3-3/3)