-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrlm_php_wordpress-fns_09-10-2011.php
126 lines (120 loc) · 4.49 KB
/
rlm_php_wordpress-fns_09-10-2011.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<?php
/* ----- Add Post Thumbnails ------------------------------------------------------------ */
if(function_exists('add_theme_support')){
add_theme_support('post-thumbnails');
add_theme_support('menus');
}
/* ----- Configure Sidebars ------------------------------------------------------------ */
$sidebar_html = array(
'before_widget' => '<nav id="%1$s" class="mod-list %2$s">',
'after_widget' => '</nav>',
'before_title' => '<header class="list-head">',
'after_title' => '</header>',
'before_body' => '<div class="wrap list-body">',
'after_body' => '</div>'
);
add_action('init', 'theme_sidebars');
function theme_sidebars(){
if(function_exists('register_sidebar')){
register_sidebar(array(
'name' => 'Site Tagline',
'id' => 'site-tagline',
'description' => 'Site Tagline is displayed next to the Site Title and under the Site Menu.',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => ''
));
register_sidebar(array(
'name' => 'Home Aside',
'id' => 'home-aside',
'description' => 'Home Aside is displayed as a sidebar (below Page Footer) on the post home page only.',
'before_widget' => '<section id="%1$s" class="%2$s">',
'after_widget' => '</section>',
'before_title' => '<header>',
'after_title' => '</header>'
));
register_sidebar(array(
'name' => 'Page Aside',
'id' => 'page-aside',
'description' => 'Page Aside is displayed as a sidebar (below Page Footer).',
'before_widget' => '<nav id="%1$s" class="mod-list %2$s">',
'after_widget' => '</div></nav>',
'before_title' => '<header class="list-head">',
'after_title' => '</header><div class="wrap list-body">'
));
register_sidebar(array(
'name' => 'Page Footer',
'id' => 'page-foot',
'description' => 'Page Footer is displayed as a sidebar (above Page Aside).',
'before_widget' => '<nav id="%1$s" class="mod-list %2$s">',
'after_widget' => '</div></nav>',
'before_title' => '<header class="list-head">',
'after_title' => '</header><div class="wrap list-body">'
));
register_sidebar(array(
'name' => 'Post Aside',
'id' => 'post-aside',
'description' => 'Post Aside is displayed as a sidebar (below Post Footer).',
'before_widget' => '<nav id="%1$s" class="mod-list %2$s">',
'after_widget' => '</div></nav>',
'before_title' => '<header class="list-head">',
'after_title' => '</header><div class="wrap list-body">'
));
register_sidebar(array(
'name' => 'Post Footer',
'id' => 'post-foot',
'description' => 'Post Footer is displayed as a sidebar (above Post Aside).',
'before_widget' => '<nav id="%1$s" class="mod-list %2$s">',
'after_widget' => '</div></nav>',
'before_title' => '<header class="list-head">',
'after_title' => '</header><div class="wrap list-body">'
));
register_sidebar(array(
'name' => 'Archive Aside',
'id' => 'archive-aside',
'description' => 'Archive Aside is displayed as a sidebar.',
'before_widget' => '<nav id="%1$s" class="mod-cloud %2$s">',
'after_widget' => '</div></nav>',
'before_title' => '<header class="cloud-head">',
'after_title' => '</header><div class="wrap cloud-body">'
));
register_sidebar(array(
'name' => 'Tag Aside',
'id' => 'tag-aside',
'description' => 'Tag Aside is displayed as a sidebar.',
'before_widget' => '<nav id="%1$s" class="mod-cloud %2$s">',
'after_widget' => '</div></nav>',
'before_title' => '<header class="cloud-head">',
'after_title' => '</header><div class="wrap cloud-body">'
));
register_sidebar(array(
'name' => 'Category Aside',
'id' => 'category-aside',
'description' => 'Category Aside is displayed as a sidebar.',
'before_widget' => '<nav id="%1$s" class="mod-cloud %2$s">',
'after_widget' => '</div></nav>',
'before_title' => '<header class="cloud-head">',
'after_title' => '</header><div class="wrap cloud-body">'
));
}
return;
} // function theme_sidebars
function is_sidebar_active($index){
global $wp_registered_sidebars;
$widgetcolumns = wp_get_sidebars_widgets();
if(array_key_exists($index, $widgetcolumns) && $widgetcolumns[$index]) return true;
return false;
} // function is_sidebar_active
/* ----- Configure Menus ------------------------------------------------------------ */
add_action('init', 'theme_menus');
function theme_menus(){
if(function_exists('register_nav_menu')){
register_nav_menu('site-menu', __('Site Menu'));
}
} // function theme_menus(
function is_menu_active($index){
if(has_nav_menu($index)) return true;
return false;
} // function is_menu_active
?>