name . ' ' . wp_get_theme()->version ) . '" />' . "\n";
}
add_action( 'wp_head', 'bunnypresslite_generator' );
}
if ( ! function_exists( 'bunnypresslite_theme_support' ) ){
function bunnypresslite_theme_support() {
add_theme_support( 'title-tag' );
add_theme_support( 'customize-selective-refresh-widgets' );
add_theme_support( 'post-thumbnails' );
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) );
if ( function_exists( 'register_nav_menus' ) ) {
register_nav_menus(
array(
'header-menu' => __( 'Header Menu', 'bunnypresslite' ),
'header-menu-sp' => __( 'Header Menu for SP only', 'bunnypresslite' ),
'footer-menu' => __( 'Footer Menu', 'bunnypresslite' ),
)
);
}
add_theme_support( 'custom-logo', array(
'flex-width' => true,
) );
add_theme_support( 'custom-background' );
add_theme_support( 'custom-header' );
}
}
add_action( 'after_setup_theme', 'bunnypresslite_theme_support' );
function bunnypresslite_widgets_init() {
register_sidebar(array(
'name' => __( 'Sidebar', 'bunnypresslite' ),
'id' => 'sidebar-1',
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
',
));
register_sidebar(array(
'name' => __( 'Content top', 'bunnypresslite' ),
'id' => 'sidebar-2',
'description' => __( 'Ideal for displaying bread crumbs.', 'bunnypresslite' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
',
));
register_sidebar(array(
'name' => __( 'Article Content Top', 'bunnypresslite' ),
'id' => 'sidebar-3',
'description' => __( 'It is displayed directly top of the article.', 'bunnypresslite' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
',
));
register_sidebar(array(
'name' => __( 'Article Content bottom', 'bunnypresslite' ),
'id' => 'sidebar-4',
'description' => __( 'It is displayed directly under the article.', 'bunnypresslite' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
',
));
register_sidebar(array(
'name' => __( 'Footer', 'bunnypresslite' ),
'id' => 'sidebar-5',
'before_widget' => '',
'before_title' => '',
'after_title' => '
',
));
}
add_action( 'widgets_init','bunnypresslite_widgets_init' );
if ( !function_exists( 'bunnypresslite_excerpt_length' ) ) {
function bunnypresslite_excerpt_length( ) {
if ( is_admin() ) {
return;
}
return 80;
}
}
add_filter( 'excerpt_length', 'bunnypresslite_excerpt_length' );
if ( !function_exists( 'custom_wp_tag_cloud' ) ) {
function custom_wp_tag_cloud($args) {
$myargs = array(
'smallest' => 9,
'largest' => 9,
);
$args = wp_parse_args($args, $myargs);
return $args;
}
}
add_filter( 'widget_tag_cloud_args', 'custom_wp_tag_cloud' );
if ( !function_exists( 'bunnypresslite_page_navi' ) ) {
function bunnypresslite_page_navi() {
$pagination = get_the_posts_pagination( array( 'mid_size' => 1 ) );
$pagination = str_replace(' role="navigation"', '', $pagination);
$allowed_html = array(
'a' => array( 'href' => array (), 'class' => array (), 'target' => array(), 'class' => array () ),
'div' => array( 'style' => array (), 'class' => array (), 'align' => array () ),
'span' => array( 'style' => array (), 'class' => array (), 'aria-current' => array () ),
'h2' => array( 'style' => array (), 'class' => array () ),
'nav' => array( 'style' => array (), 'class' => array (), 'align' => array () ),
);
echo wp_kses( $pagination, $allowed_html );
}
}
require get_template_directory() . '/inc/customizer.php';
require get_template_directory() . '/inc/customizer-add.php';
$bunnypresslite_content_width = str_replace(array('width','full'),array('','1400'),bunnypresslite_max_content_width());
if( bunnypresslite_layout() == 'one' ) {
if ( ! isset( $content_width ) ) $content_width = $bunnypresslite_content_width - 30;
}else{
if ( ! isset( $content_width ) ) $content_width = $bunnypresslite_content_width - 390;
}
if ( !function_exists( 'bunnypresslite_category_id_class' ) ) {
function bunnypresslite_category_id_class($bunnypresslite_classes) {
global $post;
if( $post && !is_search() && !is_404() ) {
foreach((get_the_category($post->ID)) as $category)
$bunnypresslite_classes [] = 'cat-' . $category->cat_ID . '-id';
}
return $bunnypresslite_classes;
}
}
add_filter('post_class', 'bunnypresslite_category_id_class');
add_filter('body_class', 'bunnypresslite_category_id_class');
if ( !function_exists( 'bunnypresslite_has_thumb_class' ) ) {
function bunnypresslite_has_thumb_class($bunnypresslite_classes) {
global $post;
if( has_post_thumbnail($post->ID) ) { $bunnypresslite_classes[] = 'has_thumb'; }
return $bunnypresslite_classes;
}
}
add_filter('post_class', 'bunnypresslite_has_thumb_class');
if ( !function_exists( 'bunnypresslite_custom_comments_list' ) ) {
function bunnypresslite_custom_comments_list($bunnypresslite_comment, $bunnypresslite_args, $bunnypresslite_depth){?>
id="li-comment-">
id="li-comment-">
' . esc_html_e('Your comment is awaiting approval.','bunnypresslite') . '
';?>