' . get_bloginfo('name') . ''; $description = get_bloginfo( 'description', 'display' ); if ( $description || is_customize_preview() ) { $html .= '

'.$description.'

'; } } } ?>

'; if( class_exists('WooCommerce') ){ if( function_exists('woocommerce_breadcrumb') && function_exists('is_woocommerce') && is_woocommerce() ){ woocommerce_breadcrumb( array( 'wrap_before'=>'', 'delimiter'=>isset($delimiter_char) ?''.$delimiter_char.'':'', 'wrap_after'=>'' ) ); return; } } $allowed_html = array( 'a' => array('href' => array(), 'title' => array()), 'span' => array('class' => array()), 'div' => array('class' => array()), 'i' => array('class' => array()) ); $output = ''; $delimiter = isset($delimiter_char) ?''.$delimiter_char.'':''; $ar_title = array( 'home' => '' ,'search' => __('Search results for ', 'blogone') ,'404' => __('Error 404', 'blogone') ,'tagged' => __('Tagged ', 'blogone') ,'author' => __('Articles posted by ', 'blogone') ,'page' => __('Page', 'blogone') ); $before = ''; /* tag before the current crumb */ $after = ''; /* tag after the current crumb */ global $wp_rewrite, $post; $rewriteUrl = $wp_rewrite->using_permalinks(); if( !is_home() && !is_front_page() || is_paged() ){ $output .= ''; $homeLink = esc_url( home_url('/') ); $output .= '' . $ar_title['home'] . ' ' . $delimiter . ' '; if( is_category() ){ global $wp_query; $cat_obj = $wp_query->get_queried_object(); $thisCat = $cat_obj->term_id; $thisCat = get_category($thisCat); $parentCat = get_category($thisCat->parent); if( $thisCat->parent != 0 ){ $output .= get_category_parents($parentCat, true, ' ' . $delimiter . ' '); } $output .= $before . single_cat_title('', false) . $after; } elseif( is_search() ){ $output .= $before . $ar_title['search'] . '"' . get_search_query() . '"' . $after; }elseif( is_day() ){ $output .= '' . get_the_time('Y') . ' ' . $delimiter . ' '; $output .= '' . get_the_time('F') . ' ' . $delimiter . ' '; $output .= $before . get_the_time('d') . $after; }elseif( is_month() ){ $output .= '' . get_the_time('Y') . ' ' . $delimiter . ' '; $output .= $before . get_the_time('F') . $after; }elseif( is_year() ){ $output .= $before . get_the_time('Y') . $after; }elseif( is_single() && !is_attachment() ){ if( get_post_type() != 'post' ){ $post_type = get_post_type_object(get_post_type()); $slug = $post_type->rewrite; $post_type_name = $post_type->labels->singular_name; if( $rewriteUrl ){ $output .= '' . $post_type_name . ' ' . $delimiter . ' '; }else{ $output .= '' . $post_type_name . ' ' . $delimiter . ' '; } $output .= $before . get_the_title() . $after; }else{ $cat = get_the_category(); $cat = $cat[0]; $output .= get_category_parents($cat, true, ' ' . $delimiter . ' '); $output .= $before . get_the_title() . $after; } }elseif( !is_single() && !is_page() && get_post_type() != 'post' && !is_404() ){ $post_type = get_post_type_object(get_post_type()); $slug = $post_type->rewrite; $post_type_name = $post_type->labels->singular_name; if( is_tag() ){ $output .= $before . $ar_title['tagged'] . '"' . single_tag_title('', false) . '"' . $after; } elseif( is_taxonomy_hierarchical(get_query_var('taxonomy')) ){ if( $rewriteUrl ){ $output .= '' . $post_type_name . ' ' . $delimiter . ' '; }else{ $output .= '' . $post_type_name . ' ' . $delimiter . ' '; } $curTaxanomy = get_query_var('taxonomy'); $curTerm = get_query_var( 'term' ); $termNow = get_term_by( 'name', $curTerm, $curTaxanomy ); $pushPrintArr = array(); if( $termNow !== false ){ while( (int)$termNow->parent != 0 ){ $parentTerm = get_term((int)$termNow->parent,get_query_var('taxonomy')); array_push($pushPrintArr,'' . $parentTerm->name . ' ' . $delimiter . ' '); $curTerm = $parentTerm->name; $termNow = get_term_by( 'name', $curTerm, $curTaxanomy ); } } $pushPrintArr = array_reverse($pushPrintArr); array_push($pushPrintArr,$before . get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) )->name . $after); $output .= implode($pushPrintArr); }else{ $output .= $before . $post_type_name . $after; } }elseif( is_attachment() ){ if( (int)$post->post_parent > 0 ){ $parent = get_post($post->post_parent); $cat = get_the_category($parent->ID); if( count($cat) > 0 ){ $cat = $cat[0]; $output .= get_category_parents($cat, true, ' ' . $delimiter . ' '); } $output .= '' . $parent->post_title . ' ' . $delimiter . ' '; } $output .= $before . get_the_title() . $after; }elseif( is_page() && !$post->post_parent ){ $output .= $before . get_the_title() . $after; }elseif( is_page() && $post->post_parent ){ $parent_id = $post->post_parent; $breadcrumbs = array(); while( $parent_id ){ $page = get_post($parent_id); $breadcrumbs[] = '' . get_the_title($page->ID) . ''; $parent_id = $page->post_parent; } $breadcrumbs = array_reverse($breadcrumbs); foreach( $breadcrumbs as $crumb ){ $output .= $crumb . ' ' . $delimiter . ' '; } $output .= $before . get_the_title() . $after; }elseif( is_tag() ){ $output .= $before . $ar_title['tagged'] . '"' . single_tag_title('', false) . '"' . $after; }elseif( is_author() ){ global $author; $userdata = get_userdata($author); $output .= $before . $ar_title['author'] . $userdata->display_name . $after; }elseif( is_404() ){ $output .= $before . $ar_title['404'] . $after; } if( get_query_var('paged') || get_query_var('page') ){ if( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() || is_page_template() || is_post_type_archive() || is_archive() ){ $output .= $before .' ('; } $output .= $ar_title['page'] . ' ' . ( get_query_var('paged')?get_query_var('paged'):get_query_var('page') ); if( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() || is_page_template() || is_post_type_archive() || is_archive() ){ $output .= ')'. $after; } } $output .= ''; } echo wp_kses($output, $allowed_html); wp_reset_postdata(); } } if ( ! function_exists( 'blogone_edit_link' ) ) : function blogone_edit_link() { edit_post_link( sprintf( /* translators: %s: Post title. */ __( 'Edit "%s"', 'blogone' ), get_the_title() ), '', '' ); } endif; if ( ! function_exists( 'blogone_author_detail' ) ) : function blogone_author_detail(){ $author_id = get_the_author_meta( 'ID' ); if(get_the_author_meta( 'description', $author_id )==''){ return; } ?>
$word_limit ){ array_pop($words); } return implode(' ', $words); } } if( !function_exists ('blogone_the_excerpt_max_words') ){ function blogone_the_excerpt_max_words( $word_limit = -1, $post = '', $strip_tags = true, $extra_str = '', $echo = true ) { if( $post ){ $excerpt = blogone_get_the_excerpt_by_id($post->ID); } else{ $excerpt = get_the_excerpt(); } if( !is_array($strip_tags) && $strip_tags ){ $excerpt = wp_strip_all_tags($excerpt); $excerpt = strip_shortcodes($excerpt); } if( is_array($strip_tags) ){ $excerpt = wp_kses($excerpt, $strip_tags); // allow, not strip } if( $word_limit != -1 ){ $result = blogone_string_limit_words($excerpt, $word_limit); if( $result != $excerpt ){ $result .= $extra_str; } } else{ $result = $excerpt; } if( $echo ){ echo do_shortcode($result); } return $result; } } if( !function_exists('blogone_get_the_excerpt_by_id') ){ function blogone_get_the_excerpt_by_id( $post_id = 0 ) { global $wpdb; $query = "SELECT post_excerpt, post_content FROM $wpdb->posts WHERE ID = %d LIMIT 1"; $result = $wpdb->get_results( $wpdb->prepare($query, $post_id), ARRAY_A ); if( $result[0]['post_excerpt'] ){ return $result[0]['post_excerpt']; } else{ $content = $result[0]['post_content']; if( false !== strpos( $content, '' ) ){ $pages = explode( '', $content ); return $pages[0]; } return $content; } } } /** * Custom excerpt length */ if ( ! function_exists( 'blogone_custom_excerpt_length' ) ) : add_filter( 'excerpt_length', 'blogone_custom_excerpt_length', 100 ); function blogone_custom_excerpt_length( $length ) { global $post; $option = blogone_theme_options(); if( is_archive() ){ $excerpt_length = $option['blogone_archive_excerpt_length']; }else{ $excerpt_length = 50; } return absint( apply_filters( 'blogone_excerpt_length', $excerpt_length ) ); } endif; /** * Remove […] */ if ( ! function_exists( 'blogone_new_excerpt_more' ) ) : add_filter('excerpt_more', 'blogone_new_excerpt_more', 15 ); function blogone_new_excerpt_more( $more ) { global $post; $option = blogone_theme_options(); if( is_archive() ){ $excerpt_readmore = $option['blogone_archive_readmore_label']; }else{ $excerpt_readmore = __('Read More','blogone'); } return apply_filters( 'blogone_excerpt_more_output', sprintf( ' ...
%1s
', esc_url( get_the_permalink() ), $excerpt_readmore ) ); } endif; /* Content Read More */ if ( ! function_exists( 'blogone_blog_content_more' ) ) : add_filter( 'the_content_more_link', 'blogone_blog_content_more', 15 ); function blogone_blog_content_more( $more ) { global $post; $option = blogone_theme_options(); if( is_archive() ){ $excerpt_readmore = $option['blogone_archive_readmore_label']; }else{ $excerpt_readmore = __('Read More','blogone'); } return apply_filters( 'blogone_content_more_link_output', sprintf( '
%3$s%4$s
', the_title_attribute( 'echo=0' ), esc_url( get_permalink( get_the_ID() ) . apply_filters( 'blogone_more_jump','#more-' . get_the_ID() ) ), wp_kses_post( $excerpt_readmore ), '' . get_the_title() . '' ) ); } endif; if( ! function_exists('blogone_get_list_sidebars') ){ function blogone_get_list_sidebars(){ return $GLOBALS['wp_registered_sidebars']; } } function blogone_placeholder_img_src( $size = 'medium' ) { $src = get_template_directory_uri() . '/img/placeholder_img.png'; $placeholder_image = get_option( 'blogone_placeholder_image', 0 ); if ( ! empty( $placeholder_image ) ) { if ( is_numeric( $placeholder_image ) ) { $image = wp_get_attachment_image_src( $placeholder_image, $size ); if ( ! empty( $image[0] ) ) { $src = $image[0]; } } else { $src = $placeholder_image; } } return apply_filters( 'blogone_placeholder_img_src', $src ); } function blogone_help_tip( $tip, $allow_html = false ) { if ( $allow_html ) { $sanitized_tip = wc_sanitize_tooltip( $tip ); } else { $sanitized_tip = esc_attr( $tip ); } return apply_filters( 'wc_help_tip', '', $sanitized_tip, $tip, $allow_html ); } // Content starter pack data function blogone_wp_starter_pack() { // Define and register starter contents $starter_content = array( 'widgets' => array( 'sidebar-1' => array( 'search', 'categories', 'tag', 'meta', ), 'footer-1' => array( 'my_text' => array( 'text', array( 'title' => _x('About US', 'My text starter contents', 'blogone'), 'text' => _x('Lorem ipsum dolor sit amet consectetur dipisicing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua Ut enim ad minim veniam.', 'My text starter contents', 'blogone'), ), ), ), 'footer-2' => array( 'search' => array( 'search', array( 'title' => _x( 'search', 'My text starter contents', 'blogone' ), ) ), ), 'footer-3' => array( 'categories'=> array( 'categories', array( 'title' => _x( 'categories', 'My text starter contents', 'blogone' ), ) ), ), ), 'posts' => array( 'home', 'about', 'contact', 'blog', ), 'options' => array( 'show_on_front' => 'page', 'page_on_front' => '{{home}}', 'page_for_posts' => '{{blog}}', 'header_image' => '', ), 'nav_menus' => array( 'primary' => array( 'name' => __( 'Primary Menu', 'blogone' ), 'items' => array( 'link_home', 'page_about', 'page_blog', 'page_contact', 'page_loremuipsum' => array( 'type' => 'post_type', 'object' => 'page', 'object_id' => '{{loremipsum}}', ), ), ), ), ); return apply_filters( 'blogone_wp_starter_pack', $starter_content ); } // Get Started Notice add_action( 'wp_ajax_blogone_dismissed_notice_handler', 'blogone_ajax_notice_handler' ); function blogone_ajax_notice_handler() { if ( isset( $_POST['type'] ) ) { $type = sanitize_text_field( wp_unslash( $_POST['type'] ) ); update_option( 'dismissed-' . $type, TRUE ); } } function blogone_deprecated_hook_admin_notice() { if ( ! get_option('dismissed-get_started', FALSE ) ) { ?>
<?php esc_attr_e( 'Theme Screenshot', 'blogone' ); ?>

'. wp_get_theme()->get('Name'). '' ); ?>

Britetechs Companion plugin for taking full advantage of all the features this theme has to offer.', 'blogone')) ?>

', '', '' ); ?>
sanitize_key( wp_unslash( 'britetechs-companion' ) ), 'fields' => array( 'sections' => false, ), ) ); $skin = new WP_Ajax_Upgrader_Skin(); $upgrader = new Plugin_Upgrader( $skin ); $result = $upgrader->install( $api->download_link ); } // Activate plugin. if ( current_user_can( 'activate_plugin' ) ) { $result = activate_plugin( 'britetechs-companion/britetechs-companion.php' ); } } add_action( 'wp_ajax_install_act_plugin', 'blogone_admin_install_plugin' );