__('Widget Area', 'base-for-original'),
'id' => 'sidebar-common',
'description' => __('Add widgets here to appear in your sidebar on all pages.', 'base-for-original' ),
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
',
) );
}
add_action('widgets_init', 'base_for_original_widgets_init');
/**
* Change title tag delimiter
*/
function base_for_original_title_separator($sep){
return '|';
}
add_filter('document_title_separator', 'base_for_original_title_separator' );
/**
* Output page slag to class of body tag
*/
function base_for_original_body_pagename_class($classes = ''){
global $post;
if(is_page()){
$page = get_page(get_the_ID());
$classes[] = 'page-'.$page->post_name;
if($post->ancestors){
foreach ($post->ancestors as $post_anc_id){
$post_id = $post_anc_id;
}
}else{
$post_id = $post->ID;
}
$ancestor_post = get_page($post_id);
$ancestor_slug = 'page-'.$ancestor_post->post_name;
$classes[] = $ancestor_slug;
}
return $classes;
}
add_filter('body_class', 'base_for_original_body_pagename_class');
?>