', esc_url( get_bloginfo( 'pingback_url' ) ) ); } } add_action( 'wp_head', 'benzile_pingback_header' ); if ( ! function_exists( 'benzile_fonts_url' ) ) : /** * Register Google fonts. * * Create your own benzile_fonts_url() function to override in a child theme. * * @since league 1.1 * * @return string Google fonts URL for the theme. */ function benzile_fonts_url() { $fonts_url = ''; $fonts = array(); $subsets = 'latin'; if ( 'off' !== _x( 'on', 'Poppins: on or off', 'benzile' ) ) { $fonts[] = 'Poppins:300,400,500,600'; } if ( 'off' !== _x( 'on', 'Kaushan Script: on or off', 'benzile' ) ) { $fonts[] = 'Kaushan Script:300,400,500,600'; } if ( $fonts ) { $fonts_url = add_query_arg( array( 'family' => urlencode( implode( '|', $fonts ) ), 'subset' => urlencode( $subsets ), ), 'https://fonts.googleapis.com/css' ); } return $fonts_url; } endif; #-----------------------------------------------------------------# # Change The Default WordPress Excerpt Length #-----------------------------------------------------------------# if ( ! function_exists( 'theme_custom_excerpt' ) ) { function theme_custom_excerpt($limit) { $excerpt = explode(' ', get_the_excerpt(), $limit); if ( count($excerpt) >= $limit ) { array_pop($excerpt); $excerpt = implode(" ", $excerpt) . '...'; } else { $excerpt = implode(" ", $excerpt); } $excerpt = preg_replace('`\[[^\]]*\]`', '', $excerpt); return $excerpt; } } function benzile_archive_page_title(){ if( is_archive() ) { $archive_text = get_theme_mod('archive_prefix', __('Archive','benzile')); echo '

'; if ( is_day() ) : printf( esc_html__( '%1$s %2$s', 'benzile' ), esc_html($archive_text), esc_html(get_the_date()) ); elseif ( is_month() ) : printf( esc_html__( '%1$s %2$s', 'benzile' ), esc_html($archive_text), esc_html(get_the_date( 'F Y' )) ); elseif ( is_year() ) : printf( esc_html__( '%1$s %2$s', 'benzile' ), esc_html($archive_text), esc_html(get_the_date( 'Y' )) ); elseif( is_category() ): $category_text = get_theme_mod('category_prefix',__('Category','benzile')); printf( esc_html__( '%1$s %2$s', 'benzile' ), esc_html($category_text), single_cat_title( '', false ) ); elseif( is_author() ): $author_text = get_theme_mod('author_prefix',__('All posts by','benzile')); printf( esc_html__( '%1$s %2$s', 'benzile' ), esc_html($author_text), esc_html(get_the_author() )); elseif( is_tag() ): $tag_text = get_theme_mod('tag_prefix',__('Tag','benzile')); printf( esc_html__( '%1$s %2$s', 'benzile' ), esc_html($tag_text), single_tag_title( '', false ) ); elseif( class_exists( 'WooCommerce' ) && is_shop() ): $shop_text = get_theme_mod('shop_prefix',__('Shop','benzile')); printf( esc_html__( '%1$s %2$s', 'benzile' ), esc_html($shop_text), single_tag_title( '', false )); elseif( is_archive() ): the_archive_title( '

', '

' ); endif; echo ''; } elseif( is_search() ) { $search_text = get_theme_mod('search_prefix',__('Search results for','benzile')); echo '

'; printf( esc_html__( '%1$s %2$s', 'benzile' ), esc_html($search_text), get_search_query() ); echo '

'; } elseif( is_404() ) { $breadcrumbs_text = get_theme_mod('404_prefix',__('404 Page Not Fouund','benzile')); echo '

'; printf( esc_html( '%1$s ') , esc_html($breadcrumbs_text) ); echo '

'; } else { $allowed_html = array( 'br' => array(), 'em' => array(), 'strong' => array(), 'i' => array( 'class' => array(), ), 'span' => array(), ); echo '

'.wp_kses( force_balance_tags( get_the_title()), $allowed_html ).'

'; } } function benzile_inline_css(){ $benzile_color_scheme = get_theme_mod( 'benzile_color_scheme', '#2b50f0' ); $benzile_custom_css = ''; $benzile_custom_css .= ' .qualities .column .icon, .blog-more-btn:hover, .blog-by-img:hover, .blog_post .post-detail h5 a:hover, ol.breadcrumb li a:hover, .widget ul li a:hover, .blog_post .post-detail:hover h5 a, .comment-meta a, .post-detail .post-status ul li i::before, .comment-meta a, .logged-in-as a { color: ' . esc_attr( $benzile_color_scheme) . ' !important; }'; $benzile_custom_css .=' .qualities .column .icon, .sub-menu li:hover>a, .owl-dots .owl-dot.active span,.heading h2::after, .blog_post .post-detail::before, .widget_calendar th, .comment-respond .form-submit input{ background-color:' . esc_attr( $benzile_color_scheme) . '!important; }'; $benzile_custom_css .=' .circle.strong-border { border-color:' . esc_attr( $benzile_color_scheme) . ' !important ; }'; $benzile_custom_css .=' .slider .owl-main .item::after,.slider .owl-main .item::before { background-color:' . esc_attr( $benzile_color_scheme) . '!important; opacity:0.8 }'; $benzile_custom_css .=' .owl-main .owl-dots button.owl-dot.active,.qualities .column:hover, .content-sec .btn-primary{ border-color:' . esc_attr( $benzile_color_scheme) . ' !important ; background-color:' . esc_attr( $benzile_color_scheme) . '!important; }'; wp_add_inline_style( 'benzile-style', $benzile_custom_css ); } add_action( 'wp_enqueue_scripts', 'benzile_inline_css' );