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' ); $args = array( 'flex-width' => true, 'flex-width' => true, ); add_theme_support( 'custom-header', $args ); } } add_action( 'after_setup_theme', 'bunnypresslite_theme_support' ); function bunnypresslite_widgets_init() { register_sidebar(array( 'name' => __( 'Sidebar', 'bunnypresslite' ), 'id' => 'sidebar-1', 'before_widget' => '
';
echo wp_kses( $noimg, $allowed_tag );
}
}
if ( !function_exists( 'bunnypresslite_thumbnail_url' ) ) {
function bunnypresslite_thumbnail_url(){
$thumbnail_id = get_post_thumbnail_id();
$thumbnail = wp_get_attachment_image_src( $thumbnail_id , 'medium' );
return $thumbnail[0];
}
}
if ( !function_exists( 'bunnypresslite_previous_post_link' ) ) {
function bunnypresslite_previous_post_link($maxlen = -1, $format='« %link', $link='%title', $in_same_cat = false, $excluded_categories = '') {
bunnypresslite_adjacent_post_link($maxlen, $format, $link, $in_same_cat, $excluded_categories, true, $maxlen);
}
}
if ( !function_exists( 'bunnypresslite_next_post_link' ) ) {
function bunnypresslite_next_post_link($maxlen = -1, $format='%link »', $link='%title', $in_same_cat = false, $excluded_categories = '') {
bunnypresslite_adjacent_post_link($maxlen, $format, $link, $in_same_cat, $excluded_categories, false);
}
}
if ( !function_exists( 'bunnypresslite_adjacent_post_link' ) ) {
function bunnypresslite_adjacent_post_link($bunnypresslite_maxlen = -1, $bunnypresslite_format='« %link', $bunnypresslite_link='%title', $bunnypresslite_in_same_cat = false, $bunnypresslite_excluded_categories = '', $bunnypresslite_previous = true) {
if ( $bunnypresslite_previous && is_attachment() ){
$bunnypresslite_post = & get_post($GLOBALS['post']->post_parent);
}else{
$bunnypresslite_post = get_adjacent_post($bunnypresslite_in_same_cat, $bunnypresslite_excluded_categories, $bunnypresslite_previous);
}
if ( !$bunnypresslite_post ) return;
$tCnt = mb_strlen( $bunnypresslite_post->post_title, get_bloginfo('charset') );
if(($bunnypresslite_maxlen > 0)&&($tCnt > $bunnypresslite_maxlen)) {
$title = mb_substr( $bunnypresslite_post->post_title, 0, $bunnypresslite_maxlen, get_bloginfo('charset') ) . '[...]';
} else {
$title = $bunnypresslite_post->post_title;
}
if ( empty($bunnypresslite_post->post_title) ) $title = $bunnypresslite_previous ? __('Previous Post','bunnypresslite') : __('Next Post','bunnypresslite');
$title = apply_filters('the_title', $title, $bunnypresslite_post->ID);
$date = mysql2date(get_option('date_format'), $bunnypresslite_post->post_date);
$rel = $bunnypresslite_previous ? 'prev' : 'next';
$string = '';
$bunnypresslite_link = str_replace('%title', $title, $bunnypresslite_link);
$bunnypresslite_link = str_replace('%date', $date, $bunnypresslite_link);
$bunnypresslite_link = $string . $bunnypresslite_link . '';
$bunnypresslite_format = str_replace('%link', $bunnypresslite_link, $bunnypresslite_format);
$allowed_html = array(
'a' => array( 'id' => array (), 'class' => array (), 'href' => array (), 'onclick' => array (), 'target' => array() ),
'div' => array( 'id' => array (), 'class' => array (), 'style' => array (), 'align' => array () ),
'img' => array( 'loading' => array (), 'id' => array (), 'class' => array (), 'style' => array (), 'align' => array (), 'src' => array (), 'data-src' => array (), 'data-lazy-src' => array (), 'border' => array (), 'width' => array (), 'height' => array (), 'alt' => array () ),
'p' => array( 'id' => array (), 'class' => array (), 'style' => array (), 'align' => array () ),
'span' => array( 'id' => array (), 'class' => array (), 'style' => array (), 'align' => array () ),
'noscript' => array( ),
);
echo wp_kses( $bunnypresslite_format , $allowed_html );
}
}
function bunnypresslite_archive_title( $title ){
if ( is_category() ) {
/* translators: %s: category term */
$title = printf( esc_html( __( 'Category Archives: %s','bunnypresslite' ), single_cat_title( '', false ) ) );
} elseif ( is_tag() ) {
/* translators: %s: tag term */
$title = printf( esc_html( __( 'Tag Archives: %s','bunnypresslite' ) , '' . single_tag_title( '', false ) . '' ) );
} elseif ( is_post_type_archive() ) {
$title = post_type_archive_title('',false);
} elseif ( is_author() ) {
$title = '' . get_the_author() . '' ;
}
return $title;
}
add_filter( 'get_the_archive_title', 'bunnypresslite_archive_title' );
if ( !function_exists( 'bunnypresslite_get_title' ) ) {
function bunnypresslite_get_title() {
if(is_front_page() || is_home() || is_404()) {
$bunnypresslite_title = printf( esc_html( str_replace('
' . esc_html_e('Your comment is awaiting approval.','bunnypresslite') . '
';?>