-
Notifications
You must be signed in to change notification settings - Fork 2
/
functions.php
executable file
·86 lines (79 loc) · 2.93 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
<?php
wp_enqueue_script('jquerymasonry', get_bloginfo('stylesheet_directory') . '/jquery.masonry.min.js',array('jquery'));
wp_enqueue_script('jquerycycle', get_bloginfo('stylesheet_directory') . '/jquery.cycle.all.js',array('jquery'));
wp_enqueue_script('hewlett.js', get_bloginfo('stylesheet_directory') . '/hewlett.js',array('jquery'));
function hewlett_twitter_shortcode( $atts ) {
return "<script src='http://widgets.twimg.com/j/2/widget.js'></script>
<script type='text/javascript' language='javascript'>
new TWTR.Widget({
version: 2,
type: 'search',
search: '#oer12hf',
interval: 6000,
title: 'Hewlett OER Grantees Meeting 2012',
subject: '#oer12hf ',
width: 188,
height: 300,
theme: {
shell: {
background: '#5FA1D0',
color: '#ffffff'
},
tweets: {
background: '#ffffff',
color: '#444444',
links: '#1985b5'
}
},
features: {
scrollbar: false,
loop: true,
live: true,
hashtags: true,
timestamp: true,
avatars: true,
behavior: 'default'
}
}).render().start();
</script>";
}
add_shortcode( 'hewlett_twitter', 'hewlett_twitter_shortcode' );
//Google Maps Shortcode
function hewlett_googleMaps_shortcode($atts, $content = null) {
extract(shortcode_atts(array(
"width" => '640',
"height" => '480',
"src" => ''
), $atts));
return '<iframe width="'.esc_attr($width).'" height="'.esc_attr($height).'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'.esc_attr($src).'&output=embed"></iframe>';
}
add_shortcode("hewlett_googlemap", "hewlett_googleMaps_shortcode");
function hewlett_iframe_shortcode( $atts ){
extract( shortcode_atts( array(
'width' => '715',
'height' => '1180',
'src' => ''
), $atts )
);
$output = '<iframe src=" ' . esc_attr($src) . '" allowfullscreen="" width="'. esc_attr($width) . '" frameborder="0" height="' . esc_attr($height) . '" ></iframe>';
return $output;
}
add_shortcode( 'hewlett_iframe', 'hewlett_iframe_shortcode' );
function storify_shortcode( $atts ){
extract( shortcode_atts( array(
'user' => 'berkmancenter',
'story' => 'oer-grantees-meeting-2012-opening-exercise-part-1'
), $atts ));
return '<script src="http://storify.com/' . esc_attr($user) . '/' . esc_attr($story) . '.js"></script><noscript>[<a href="//storify.com/' . esc_attr($user) . '/' . esc_attr($story) .'" target="_blank">View the story on Storify</a>]</noscript>';
}
add_shortcode( 'storify', 'storify_shortcode' );
add_filter('widget_text', 'do_shortcode');
register_sidebar(array(
'name' => 'MidSidebar',
'id' => 'mid-sidebar',
'description' => 'Widgets in this area will be shown on the next to the slider image.',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => "</aside>",
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
));