]*>/i', '', $string); $string=preg_replace('/<\/'.$tag.'>/i', '', $string); return $string; } if( ! function_exists( 'beautystore_breadcrumbs_cb' ) ): /** * Custom Bread Crumb * * @link http://www.qualitytuts.com/wordpress-custom-breadcrumbs-without-plugin/ */ function beautystore_breadcrumbs_cb() { $showOnHome = 0; // 1 - show breadcrumbs on the homepage, 0 - don't show $delimiter = ''; $showCurrent= esc_html__('1','beautystore'); // Current post/page title in breadcrumb in use 1, Use 0 for don't show $home = esc_html__('Home','beautystore'); // text page title in breadcrumbs, 0 - don't show $before = '
  • '; // 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 . __('Archive by category','beautystore').' "' . esc_html(single_cat_title('', false)) . '"' .$after; } elseif ( is_search() ) { echo $before . __('Search results for ','beautystore').' "' . 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 . __('Posts tagged ','beautystore').' "' . single_tag_title('', false) . '"' . $after; } elseif ( is_author() ) { global $author; $userdata = get_userdata($author); echo $before . __('Articles posted by ','beautystore').'' . $userdata->display_name . $after; } elseif ( is_404() ) { echo $before . __('404 ','beautystore'). $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','beautystore') . '' . esc_html(get_query_var('paged')). ' )'; if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ''; } } } // end beautystore_breadcrumbs() endif; // End function_exists add_action( 'beautystore_breadcrumbs', 'beautystore_breadcrumbs_cb' ); if ( ! function_exists( 'beautystore_excerpt_more' ) ) : /** * Replaces "[...]" (appended to automatically generated excerpts) with ... * */ function beautystore_excerpt_more($more) { return is_admin() ? $more : ' … '; } endif; add_filter( 'excerpt_more', 'beautystore_excerpt_more' ); if ( ! function_exists( 'beautystore_excerpt_length' ) ) : /** * Changes the default 55 character in excerpt */ function beautystore_excerpt_length( $length ) { if( is_page_template('template-home.php') ){ return 20; }else{ return 55;} } endif; add_filter( 'excerpt_length', 'beautystore_excerpt_length', 999 ); if( ! function_exists( 'beautystore_get_sections' ) ): /** Function to get Sections */ function beautystore_get_sections(){ $beautystore_sections = array( 'banner-section' => array( 'class' => 'banner-section', 'id' => 'banner' ), 'about-section' => array( 'class' => 'welcome-note', 'id' => 'about' ), 'featured-section' => array( 'class' => 'section t-gray-section', 'id' => 'featured' ), 'blog-section' => array( 'class' => 'section patern-1', 'id' => 'service', 'default'=>'1' ), ); $beautystore_enabled_section = array(); foreach ( $beautystore_sections as $beautystore_section ) { if ( esc_attr( get_theme_mod( 'beautystore_ed_' . $beautystore_section['id'] . '_section' ) ) == 1 ){ $beautystore_enabled_section[] = array( 'id' => $beautystore_section['id'], 'class' => $beautystore_section['class'] ); } } return $beautystore_enabled_section; } endif; if( ! function_exists( 'beautystore_banner_cb' ) ): /** CallBack function for Banner */ function beautystore_banner_cb(){ $beautystore_ed_banner_section = get_theme_mod( 'beautystore_ed_banner_section' ); $beautystore_banner_post = get_theme_mod( 'beautystore_banner_post' ); $beautystore_enabled_sections = beautystore_get_sections(); if( $beautystore_ed_banner_section ){ if( $beautystore_banner_post) { $about_qry = new WP_Query( array( 'post_type' => 'page','p' => $beautystore_banner_post ) ); if( $about_qry->have_posts() ){ while( $about_qry->have_posts() ){ $about_qry->the_post(); ?> '; } } wp_reset_postdata(); } } } } endif; add_action( 'beautystore_banner', 'beautystore_banner_cb' ); if( ! function_exists( 'beautystore_footer_credit' ) ): /** * Footer Credits */ function beautystore_footer_credit(){ $copyright_text = get_theme_mod( 'beautystore_footer_copyright_text' ); $text = '
    '; if( $copyright_text ){ $text .= wp_kses_post( $copyright_text ); }else{ $text .= esc_html__( '© ', 'beautystore' ) . date_i18n( esc_html__( 'Y', 'beautystore' ) ); $text .= ' ' . esc_html( get_bloginfo( 'name' ) ) . ''. esc_html__( '. All Rights Reserved.', 'beautystore' ); } $text .= ''; if ( function_exists( 'the_privacy_policy_link' ) ) { $text .= get_the_privacy_policy_link(); } $text .= '
    '; echo apply_filters( 'beautystore_footer_text', $text ); } add_action( 'beautystore_footer', 'beautystore_footer_credit' ); endif; if( ! function_exists( 'beautystore_change_comment_form_default_fields' ) ) : /** * Change Comment form default fields i.e. author, email & url. */ function beautystore_change_comment_form_default_fields( $fields ){ // get the current commenter if available $commenter = wp_get_current_commenter(); // core functionality $req = get_option( 'require_name_email' ); $aria_req = ( $req ? " aria-required='true'" : '' ); // Change just the author field $fields['author'] = '

    '; $fields['email'] = '

    '; $fields['url'] = '

    '; return $fields; } endif; add_filter( 'comment_form_default_fields', 'beautystore_change_comment_form_default_fields' ); if( ! function_exists( 'beautystore_change_comment_form_defaults' ) ) : /** * Change Comment Form defaults */ function beautystore_change_comment_form_defaults( $fields ){ $comment_field = $fields['comment']; $fields['comment'] = '

    ';; return $fields; } endif; add_filter( 'comment_form_fields', 'beautystore_change_comment_form_defaults' ); if( ! function_exists( 'beautystore_escape_text_tags' ) ) : /** * Remove new line tags from string * * @param $text * @return string */ function beautystore_escape_text_tags( $text ) { return (string) str_replace( array( "\r", "\n" ), '', strip_tags( $text ) ); } endif; function beautystore_custom_header_setup() { add_theme_support( 'custom-header', apply_filters( 'beautystore_custom_header_args', array( 'default-image' => get_template_directory_uri() . '/assets/images/header.jpg', 'default-text-color' => '000000', 'width' => 1920, 'height' => 850, 'flex-height' => true, 'wp-head-callback' => 'beautystore_header_style', ) ) ); } add_action( 'after_setup_theme', 'beautystore_custom_header_setup' ); if ( ! function_exists( 'beautystore_header_style' ) ) : function beautystore_header_style() { $header_text_color = get_header_textcolor(); ?> tag. */ do_action( 'wp_body_open' ); } endif; ?>