-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
45 lines (37 loc) · 1.04 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
<?php
register_nav_menus( array(
'nav' => 'Primary menu',
'navi' => 'Secondary menu'
) );
function wpb_list_child_pages() {
global $post;
if ( is_page() && $post->post_parent )
$childpages = wp_list_pages(
'sort_column=menu_order&title_li=&child_of=' .
$post->post_parent . '&echo=0'
);
else
$childpages = wp_list_pages(
'sort_column=menu_order&title_li=&child_of=' .
$post->ID . '&echo=0'
);
if ( $childpages ) {
$string = '<ul>' . $childpages . '</ul>';
}
return $string;
}
add_shortcode('wpb_childpages', 'wpb_list_child_pages');
function social_widgets_init() {
register_sidebar( array(
'name' => 'Left sidebar',
'id' => 'main-sidebar',
'before_widget' => '<div>',
'after_widget' => '</div>',
'before_title' => '<h3 class="rounded">',
'after_title' => '</h3>',
) );
}
add_action( 'widgets_init', 'social_widgets_init' );
$editor = get_role('editor');
// add $cap capability to this role object
$editor->add_cap('edit_theme_options');