forked from AndyStaple/GumbyPress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
47 lines (41 loc) · 1.49 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
<?php
// Add Menu Support and create 2 Menus
add_theme_support('menus');
register_nav_menus(array(
'primary_navigation' => __('Primary Navigation'),
'utility_navigation' => __('Utility Navigation')
));
// create widget areas: sidebar, footer
$sidebars = array('Sidebar');
foreach ($sidebars as $sidebar) {
register_sidebar(array('name'=> $sidebar,
'before_widget' => '<article id="%1$s" class="row widget %2$s"><div class="sidebar-section twelve columns">',
'after_widget' => '</div></article>',
'before_title' => '<h4>',
'after_title' => '</h4>'
));
}
$sidebars = array('Footer');
foreach ($sidebars as $sidebar) {
register_sidebar(array('name'=> $sidebar,
'before_widget' => '<article id="%1$s" class="four columns widget %2$s"><div class="footer-section">',
'after_widget' => '</div></article>',
'before_title' => '<h4>',
'after_title' => '</h4>'
));
}
// turns captions into HTML5 validated figure/figcaption structure
add_filter('img_caption_shortcode', 'orangegnome_img_caption_shortcode_filter',10,3);
function orangegnome_img_caption_shortcode_filter($val, $attr, $content = null) {
extract(shortcode_atts(array(
'id' => '',
'align' => '',
'width' => '',
'caption' => ''
), $attr));
if ( 1 > (int) $width || empty($caption) )
return $val;
return '<figure id="' . $id . '" class="wp-caption ' . esc_attr($align) . '" style="width: ' . $width . 'px;">'
. do_shortcode( $content ) . '<figcaption class="wp-caption-text">' . $caption . '</figcaption></figure>';
}
?>