'; // tag before the current crumb
$after = ''; // tag after the current crumb
global $post;
$homeLink = esc_url( home_url( ) );
if ( is_front_page() ) {
if ( $showOnHome == 1 )
echo '' . esc_html($home) . '';
} else {
echo '' . esc_html($home) . '';
if ( is_category() )
{
$thisCat = get_category(get_query_var('cat'), false);
if ($thisCat->parent != 0) echo ''. get_category_parents($thisCat->parent, TRUE, ' ' . ' ').'';
echo $before . esc_html__('Archive by category','bitstream').' "' . esc_html(single_cat_title('', false)) . '"' .$after;
}
elseif ( is_search() )
{
echo $before . esc_html__('Search results for ','bitstream').' "' . esc_html(get_search_query()) . '"' . $after;
}
elseif ( is_day() )
{
echo '' . esc_html(get_the_time('Y')) . ' ';
echo '' . esc_html(get_the_time('F')) . ' ';
echo $before . esc_html(get_the_time('d')) . $after;
}
elseif ( is_month() )
{
echo '' . esc_html(get_the_time('Y')) . ' ' . esc_attr($delimiter);
echo $before . esc_html(get_the_time('F')) . $after;
}
elseif ( is_year() )
{
echo $before . esc_html(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;
echo '' . $post_type->labels->singular_name . '';
if ($showCurrent == 1) echo ' ' . esc_attr($delimiter) . '  /  ' . $before . esc_html(get_the_title()) . $after;
}
else
{
$cat = get_the_category(); $cat = $cat[0];
$cats = get_category_parents($cat, TRUE, ' ' . esc_attr($delimiter) . '');
if ($showCurrent == 0) $cats = preg_replace("#^(.+)\s$delimiter\s$#", "$1", $cats);
echo ''.$cats.'';
if ($showCurrent == 1) echo $before . esc_html(get_the_title()) . $after;
}
}
elseif ( !is_single() && !is_page() && get_post_type() != 'post' && !is_404() ) {
if ( class_exists( 'WooCommerce' ) ) {
if ( is_shop() ) {
$thisshop = woocommerce_page_title();
}
}
else {
$post_type = get_post_type_object(get_post_type());
echo $before . $post_type->labels->singular_name . $after;
}
}
elseif ( !is_single() && !is_page() && get_post_type() != 'post' && !is_404() )
{
$post_type = get_post_type_object(get_post_type());
echo $before . $post_type->labels->singular_name . $after;
}
elseif ( is_attachment() )
{
$parent = get_post($post->post_parent);
$cat = get_the_category($parent->ID);
if(!empty($cat)){
$cat = $cat[0];
echo get_category_parents($cat, TRUE, ' ' . esc_attr($delimiter) . '');
}
echo '' . $parent->post_title . '';
if ($showCurrent == 1) echo ' ' . esc_attr($delimiter) . ' ' . $before . esc_html(get_the_title()) . $after;
}
elseif ( is_page() && !$post->post_parent )
{
if ($showCurrent == 1) echo $before . esc_html(get_the_title()) . $after;
}
elseif ( is_page() && $post->post_parent )
{
$parent_id = $post->post_parent;
$breadcrumbs = array();
while ($parent_id)
{
$page = get_page($parent_id);
$breadcrumbs[] = '' . esc_html(get_the_title($page->ID)) . '' . '';
$parent_id = $page->post_parent;
}
$breadcrumbs = array_reverse($breadcrumbs);
for ($i = 0; $i < count($breadcrumbs); $i++)
{
echo $breadcrumbs[$i];
if ($i != count($breadcrumbs)-1) echo ' ' . esc_attr($delimiter) . '';
}
if ($showCurrent == 1) echo ' ' . esc_attr($delimiter) . ' ' . $before . esc_html(get_the_title()) . $after;
}
elseif ( is_tag() )
{
echo $before . esc_html__('Posts tagged ','bitstream').' "' . single_tag_title('', false) . '"' . $after;
}
elseif ( is_author() ) {
global $author;
$userdata = get_userdata($author);
echo $before . esc_html__('Articles posted by ','bitstream').'' . $userdata->display_name . $after;
}
elseif ( is_404() ) {
echo $before . esc_html__('404 ','bitstream'). $after;
}
if ( get_query_var('paged') ) {
if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo '';
echo ' ( ' . esc_html__('Page','bitstream') . '' . esc_html(get_query_var('paged')). ' )';
if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo '';
}
}
} // end bitstream_breadcrumbs()
endif; // End function_exists
add_action( 'bitstream_breadcrumbs', 'bitstream_breadcrumbs_cb' );
/**
* Commnet Form
*/
function bitstream_comment_field_to_bottom( $fields ) {
$comment_field = $fields['comment'];
unset( $fields['comment'] );
$fields['comment'] = $comment_field;
return $fields;
}
add_filter( 'comment_form_fields', 'bitstream_comment_field_to_bottom' );
#-----------------------------------------------------------------#
# 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 bitstream_inline_css(){
$bitstream_color_scheme = get_theme_mod( 'bitstream_color_scheme', '#2ed9f5' );
$custom_css = '';
$custom_css .= '
.icon_top i, .icon_top .info_label,
header .main-navbar .navbar-nav .nav-link:hover,
header .main-navbar .navbar-nav .nav-link:focus,
.owl-carousel .owl-nav button,
a.btn.btn-theme.dark-color,
.main_slider .owl-carousel.home-slider.owl-loaded .owl-nav button,
.service-content:hover .service-title,
.service-content:focus .service-title,
.about-list h5 i,
.team_mbr_col:hover .mbr_name h3,
.team_mbr_col:focus .mbr_name h3,
.team_mbr .team_mbr_col .social_share li a:hover,
.team_mbr .team_mbr_col .social_share li a:focus,
.client_name h3,
.video_btn_slider a:hover,
.video_btn_slider a:focus ,
.team_mbr_col .social_share li:hover a,
.team_mbr_col .social_share li:focus a,
.package-content a:hover,
.meta-tag li a:hover,
.read-btn:hover,
.package-content a:focus,
.meta-tag li a:focus,
.read-btn:focus ,
.recent-post .post-right h5:hover,
.recent-post .post-right h5:focus,
.comment-box .right-comment-content>a:hover,
.comment-box .right-comment-content>a:focus ,
header .main-navbar .navbar-nav li a:hover,
header .main-navbar .navbar-nav li a:focus,
header .main-navbar div.menuon ul li a:hover,
header .main-navbar div.menuon ul li a:focus ,
.widget ul li a:hover,
.widget ul li a:focus,.nav-links a:hover,
.nav-links a:focus,.comment-reply-link:hover,
.comment-reply-link:focus,
.url:hover,.url:focus,
.owl-carousel .owl-nav button.owl-next,
.owl-carousel .owl-nav button.owl-prev,
.owl-carousel button.owl-dot
{
color: ' . esc_attr( $bitstream_color_scheme) . ';
}';
$custom_css .='
.mini-topbar,
.dropdown-menu a:hover,
.dropdown-menu a:focus,
.dropdown-menu a.active,
.owl-carousel .owl-nav button:hover,
.owl-carousel .owl-nav button:focus,
.main_slider .social_share li a i:hover:before,
.main_slider .social_share li a i:focus:before,
.home-slider button.owl-dot.active,
.icon_col span,.contact-section .form-group select.form-control ,
#page-anim-preloader:after,#return-to-top,.tags-btn a:hover,
.tags-btn a:focus,.page-item.active .page-link,.comment-form button.btn:hover,
.comment-form button.btn:focus,.menu-item-has-children .sub-menu a:hover,
.menu-item-has-children .sub-menu a:focus,
.menu-item-has-children .sub-menu a.active,
.page_item_has_children .children a:hover,
.page_item_has_children .children a:focus,
.page_item_has_children .children a.active,.tagcloud a:hover ,
.tagcloud a:focus,.nav-links .current ,.comment-respond .form-submit input:hover,
.comment-respond .form-submit input:focus,.comment-respond .form-submit .submit,
.comment-respond .form-submit .submit:hover,
.comment-respond .form-submit .submit:focus,.comment-reply-title:before,
.btn, .btn:link, .btn:visited
{
background-color:' . esc_attr( $bitstream_color_scheme) . '!important;
}';
$custom_css .='
.page-item.active .page-link,.tagcloud a:hover ,
.tagcloud a:focus,.nav-links .current ,.comment-respond .form-submit .submit
{
border-color:' . esc_attr( $bitstream_color_scheme) . ' ;
}';
$custom_css .='
.service-content-provide:hover,
.service-content-provide:focus
{
border-color:1px dashed' . esc_attr( $bitstream_color_scheme) . ' ;
}';
$custom_css .='
.comment-box img,.comment-form button.btn ,
.comment-author.vcard img
{
border:3px solid' . esc_attr( $bitstream_color_scheme) . ' ;
}';
$custom_css .='
.slider_1 .right-img-box:before
{
border:6px solid' . esc_attr( $bitstream_color_scheme) . ' ;
}';
$custom_css .='
.service-content:hover,
.service-content:focus,.service_video_inner,
.team_mbr_col:hover,
.team_mbr_col:focus,#return-to-top
{
box-shadow: 0px 0px 12px ' . esc_attr( $bitstream_color_scheme) . ' ;
}';
$custom_css .='
.home-slider.owl-carousel .btn
{
box-shadow: 0 0 14px 0 ' . esc_attr( $bitstream_color_scheme) . ' ;
}';
$custom_css .='
@media (max-width: 992px){
.navbar-nav li a:hover,
.navbar-nav li a:focus,
div.menuon ul li a:hover,
div.menuon ul li a:focus,
{
color: ' . esc_attr( $bitstream_color_scheme) . ' ;
}
}';
$custom_css .='
.navbar-brand img{
height:'.esc_attr(get_theme_mod('bitstream_logo_heigth','63')).'px;
width:'.esc_attr(get_theme_mod('bitstream_logo_width','220')).'px;
}';
wp_register_style( 'bitstream-style', false );
wp_enqueue_style( 'bitstream-style', get_template_directory_uri() . '/assets/css/custom-header-style.css' );
wp_add_inline_style( 'bitstream-style', $custom_css );
}
add_action( 'wp_enqueue_scripts', 'bitstream_inline_css' );