Пример #1
0
function hocwp_shop_save_product_meta($post_id)
{
    if (!hocwp_can_save_post($post_id)) {
        return;
    }
    if (!hocwp_is_shop_site() || hocwp_wc_installed()) {
        return;
    }
    if (isset($_POST['sku'])) {
        update_post_meta($post_id, 'sku', $_POST['sku']);
    }
    $regular_price = hocwp_get_method_value('regular_price');
    $sale_price = hocwp_get_method_value('sale_price');
    $prices = hocwp_sanitize_product_price($regular_price, $sale_price, $post_id);
    update_post_meta($post_id, 'regular_price', $prices['regular_price']);
    update_post_meta($post_id, 'sale_price', $prices['sale_price']);
    update_post_meta($post_id, 'price', $prices['price']);
    if (isset($_POST['short_description'])) {
        update_post_meta($post_id, 'short_description', $_POST['short_description']);
    }
    $out_of_stock = hocwp_checkbox_post_data_value($_POST, 'out_of_stock');
    update_post_meta($post_id, 'out_of_stock', $out_of_stock);
    if (isset($_POST['gallery'])) {
        update_post_meta($post_id, 'gallery', $_POST['gallery']);
    }
}
Пример #2
0
function hocwp_theme_more_product_meta_boxes_init($post_type, $post)
{
    if (hocwp_wc_installed()) {
        $args = array('posts_per_page' => -1, 'post_type' => 'hocwp_product_tab');
        $query = hocwp_query($args);
        if ($query->have_posts()) {
            hocwp_theme_meta_product_tab_field_box_helper($query->posts);
        }
    } else {
        if (hocwp_is_shop_site()) {
            hocwp_shop_product_meta_boxes($post_type, $post);
        }
    }
}
 public function save_term_data($term_id)
 {
     $taxonomy = isset($_REQUEST['taxonomy']) ? $_REQUEST['taxonomy'] : '';
     $fields = $this->get_fields();
     foreach ($fields as $field) {
         $type = isset($field['type']) ? $field['type'] : 'default';
         $name = isset($field['field_args']['name']) ? $field['field_args']['name'] : '';
         if (empty($name)) {
             continue;
         }
         $value = hocwp_sanitize_form_post($name, $type);
         hocwp_term_update_meta($term_id, $name, $value);
         if ('thumbnail' == $name) {
             if ('product_cat' == $taxonomy && hocwp_wc_installed()) {
                 $value = hocwp_sanitize_media_value($value);
                 $id = $value['id'];
                 if (hocwp_id_number_valid($id)) {
                     hocwp_term_update_meta($term_id, 'thumbnail_id', $id);
                 } else {
                     hocwp_term_update_meta($term_id, 'thumbnail_id', '');
                 }
             }
         }
     }
     return $term_id;
 }
function hocwp_theme_translation_wp_list_comments_args($args)
{
    if (hocwp_wc_installed() && is_singular('product')) {
        return $args;
    }
    $args['reply_text'] = '<i class="fa fa-reply"></i><span class="text">' . 'Trả lời' . '</span>';
    $args['callback'] = 'hocwp_theme_translation_comments_list_callback';
    return $args;
}
    public function list_post_html($args, $instance, WP_Query $query)
    {
        $post_type = $this->get_post_type_from_instance($instance);
        $post_types = array();
        foreach ($post_type as $fvdata) {
            $ptvalue = isset($fvdata['value']) ? $fvdata['value'] : '';
            if (!empty($ptvalue)) {
                $post_types[] = $ptvalue;
            }
        }
        $full_width_post = hocwp_get_value_by_key($instance, 'full_width_post', $this->args['full_width_post']);
        $hide_thumbnail = hocwp_get_value_by_key($instance, 'hide_thumbnail', hocwp_get_value_by_key($this->args, 'hide_thumbnail'));
        $thumbnail_size = isset($instance['thumbnail_size']) ? $instance['thumbnail_size'] : $this->args['thumbnail_size'];
        $thumbnail_size = hocwp_sanitize_size($thumbnail_size);
        $excerpt_length = isset($instance['excerpt_length']) ? $instance['excerpt_length'] : $this->args['excerpt_length'];
        $title_length = hocwp_get_value_by_key($instance, 'title_length', hocwp_get_value_by_key($this->args, 'title_length'));
        $list_class = 'list-unstyled';
        foreach ($post_types as $ptvalue) {
            hocwp_add_string_with_space_before($list_class, 'list-' . $ptvalue . 's');
        }
        $list_class = apply_filters('hocwp_widget_post_list_class', $list_class, $args, $instance, $this);
        $widget_html = '<ul class="' . $list_class . '">';
        $loop_html = apply_filters('hocwp_widget_post_loop_html', '', $args, $instance, $this);
        if (empty($loop_html)) {
            $count = 0;
            ob_start();
            while ($query->have_posts()) {
                $query->the_post();
                $post_id = get_the_ID();
                $post = get_post($post_id);
                $class = 'a-widget-post';
                $full_width = false;
                if ('all' == $full_width_post) {
                    $full_width = true;
                } elseif ('first' == $full_width_post && 0 == $count) {
                    $full_width = true;
                } elseif ('last' == $full_width_post && $count == $query->post_count) {
                    $full_width = true;
                } elseif ('first_last' == $full_width_post && (0 == $count || $count == $query->post_count)) {
                    $full_width = true;
                } elseif ('odd' == $full_width_post && $count % 2 != 0) {
                    $full_width = true;
                } elseif ('even' == $full_width_post && $count % 2 == 0) {
                    $full_width = true;
                }
                if ($full_width) {
                    hocwp_add_string_with_space_before($class, 'full-width');
                }
                if ($hide_thumbnail) {
                    hocwp_add_string_with_space_before($class, 'hide-thumbnail');
                }
                if (hocwp_is_positive_number($excerpt_length)) {
                    hocwp_add_string_with_space_before($class, 'show-excerpt');
                } else {
                    hocwp_add_string_with_space_before($class, 'hide-excerpt');
                }
                ?>
				<li <?php 
                post_class($class);
                ?>
>
					<?php 
                do_action('hocwp_widget_post_before_post', $args, $instance, $this);
                if (!(bool) $hide_thumbnail) {
                    if ('coupon' == $post->post_type) {
                        echo '<div class="text-center code-data">';
                        $percent = hocwp_get_coupon_percent_label($post_id);
                        $text = hocwp_get_coupon_text_label($post_id);
                        $type_text = 'Website Coupons';
                        $type_term = hocwp_get_coupon_type_term($post_id);
                        if (is_a($type_term, 'WP_Term')) {
                            $type_text = $type_term->name;
                        }
                        $tmp = hocwp_get_coupon_type($post_id);
                        if (is_array($tmp)) {
                            $tmp = array_shift($tmp);
                            if (!empty($tmp)) {
                                $type_text = $tmp;
                            }
                        }
                        $price = hocwp_get_post_meta('price', $post_id);
                        $sale_price = hocwp_get_post_meta('sale_price', $post_id);
                        if (!empty($price) && !empty($sale_price) || empty($percent)) {
                            $percentage = hocwp_percentage($price, $sale_price);
                            $percent = $percentage . '%';
                            $text = 'OFF';
                        }
                        ?>
							<div class="txt"><?php 
                        echo $percent . ' ' . $text;
                        ?>
</div>
							<div class="type"><?php 
                        echo $type_text;
                        ?>
</div>
							<?php 
                        echo '</div>';
                    } else {
                        $thumbnail_args = array('width' => $thumbnail_size[0], 'height' => $thumbnail_size[1]);
                        if ($full_width) {
                            unset($thumbnail_args['width']);
                            unset($thumbnail_args['height']);
                        }
                        hocwp_post_thumbnail($thumbnail_args);
                    }
                }
                do_action('hocwp_widget_post_before_post_title', $args, $instance, $this);
                hocwp_post_title_link(array('title' => hocwp_substr(get_the_title(), $title_length)));
                do_action('hocwp_widget_post_after_post_title', $args, $instance, $this);
                if (0 < $excerpt_length) {
                    $post_type = get_post_type($post_id);
                    if ('product' == $post_type && hocwp_wc_installed()) {
                        hocwp_wc_product_price(null, true);
                    } else {
                        hocwp_entry_summary($excerpt_length);
                    }
                }
                do_action('hocwp_widget_post_after_post', $args, $instance, $this);
                ?>
				</li>
				<?php 
                $count++;
            }
            wp_reset_postdata();
            $loop_html .= ob_get_clean();
        }
        $widget_html .= $loop_html;
        $widget_html .= '</ul>';
        return $widget_html;
    }
function hocwp_setup_theme_pre_get_posts(WP_Query $query)
{
    if ($query->is_main_query()) {
        if (is_home()) {
            $options = hocwp_option_home_setting();
            $posts_per_page = absint(hocwp_get_value_by_key($options, 'posts_per_page'));
            $query->set('posts_per_page', $posts_per_page);
        } elseif (is_search()) {
        }
        if (hocwp_wc_installed()) {
            if (is_search() || is_archive() && function_exists('is_woocommerce') && is_woocommerce()) {
                if (!isset($_POST['ppp'])) {
                    $query->set('posts_per_page', hocwp_get_product_posts_per_page());
                }
            }
            if (is_search()) {
                $search_cat = hocwp_get_method_value('search_cat', 'request');
                if (hocwp_id_number_valid($search_cat)) {
                    $tax_query = array(array('taxonomy' => 'product_cat', 'field' => 'id', 'terms' => array($search_cat)));
                    $query->set('tax_query', $tax_query);
                }
            }
        }
    }
    return $query;
}
Пример #7
0
function hocwp_setup_theme_new_post_type_and_taxonomy()
{
    $args = array('name' => 'Sidebars', 'singular_name' => 'Sidebar', 'slug' => 'hocwp_sidebar', 'show_in_menu' => '', 'labels' => array('all_items' => 'Sidebars'));
    hocwp_register_post_type_private($args);
    if (hocwp_wc_installed()) {
        $args = array('name' => 'Product Tabs', 'singular_name' => 'Product Tab', 'slug' => 'hocwp_product_tab', 'show_in_menu' => '', 'labels' => array('all_items' => 'Product Tabs'), 'supports' => array('editor'));
        hocwp_register_post_type_private($args);
    }
    $args = array('name' => 'Sliders', 'singular_name' => 'Slider', 'slug' => 'hocwp_slider', 'show_in_menu' => '', 'labels' => array('all_items' => 'Sliders'));
    hocwp_register_post_type_private($args);
    $args = array('name' => 'Ads', 'singular_name' => 'Ads', 'slug' => 'hocwp_ads', 'show_in_menu' => '', 'labels' => array('all_items' => 'Ads'));
    hocwp_register_post_type_private($args);
    $user_subscribe = apply_filters('hocwp_allow_user_subscribe', false);
    if ($user_subscribe) {
        $args = array('name' => 'Subscribers', 'singular_name' => 'Subscriber', 'slug' => 'hocwp_subscriber', 'show_in_menu' => '', 'labels' => array('all_items' => 'Subscribers'));
        hocwp_register_post_type_private($args);
    }
}
Пример #8
0
function hocwp_wc_body_classes($classes)
{
    if (hocwp_wc_custom_quantity_input()) {
        $classes[] = 'hocwp-custom-quantity';
    }
    $classes[] = 'hocwp-shop-site';
    if (is_singular('product')) {
        $left_gallery = hocwp_wc_single_product_gallery_left();
        if ($left_gallery) {
            $classes[] = 'gallery-on-left';
        }
        unset($left_gallery);
        $thumbnail_on_gallery = hocwp_wc_single_product_thumbnail_on_gallery();
        if ($thumbnail_on_gallery) {
            $classes[] = 'thumbnail-on-gallery';
        }
        unset($thumbnail_on_gallery);
        $thumbnail_zooming = hocwp_wc_single_product_thumbnail_zooming();
        if ($thumbnail_zooming) {
            $classes[] = 'thumbnail-zooming';
        }
        unset($thumbnail_zooming);
        $thumbnail_preview = hocwp_wc_single_product_gallery_preview();
        if ($thumbnail_preview) {
            $classes[] = 'thumbnail-preview';
            $classes[] = 'gallery-preview';
        }
        unset($thumbnail_preview);
    }
    if (hocwp_wc_installed() && is_woocommerce()) {
        $classes[] = 'archive-product';
    }
    return $classes;
}
Пример #9
0
$options = wp_parse_args($options, hocwp_option_reading_defaults());
$option = new HOCWP_Option(__('Reading', 'hocwp-theme'), 'hocwp_reading');
$option->set_parent_slug('hocwp_theme_option');
$option->set_use_media_upload(true);
$option->add_field(array('id' => 'statistics', 'title' => __('Statistics', 'hocwp-theme'), 'field_callback' => 'hocwp_field_input_checkbox', 'label' => __('Check here if you want to enable user statistics on your site.', 'hocwp-theme')));
$option->add_field(array('id' => 'trending', 'title' => __('Trending', 'hocwp-theme'), 'field_callback' => 'hocwp_field_input_checkbox', 'label' => __('Track trending post?', 'hocwp-theme')));
$option->add_field(array('id' => 'search_tracking', 'title' => __('Search Tracking', 'hocwp-theme'), 'field_callback' => 'hocwp_field_input_checkbox', 'label' => __('Tracking search query on your site?', 'hocwp-theme')));
$option->add_field(array('id' => 'post_statistics', 'title' => __('Post Statistics', 'hocwp-theme'), 'field_callback' => 'hocwp_field_input_checkbox', 'label' => __('Track post views on your site.', 'hocwp-theme')));
$option->add_field(array('id' => 'sticky_widget', 'title' => __('Sticky Widget', 'hocwp-theme'), 'field_callback' => 'hocwp_field_input_checkbox', 'label' => __('Make last widget fixed when scroll down.', 'hocwp-theme')));
$option->add_field(array('id' => 'redirect_404', 'title' => __('Redirect 404', 'hocwp-theme'), 'field_callback' => 'hocwp_field_input_checkbox', 'label' => __('Auto redirect 404 page to homepage.', 'hocwp-theme')));
$option->add_field(array('id' => 'bold_first_paragraph', 'title' => __('Bold First Paragraph', 'hocwp-theme'), 'field_callback' => 'hocwp_field_input_checkbox', 'label' => __('Automatically bold first paragraph of content?', 'hocwp-theme')));
$option->add_field(array('id' => 'enlarge_thumbnail', 'title' => __('Enlarge Thumbnail', 'hocwp-theme'), 'field_callback' => 'hocwp_field_input_checkbox', 'label' => __('Enlarge post thumbnail when using mobile?', 'hocwp-theme')));
$option->add_field(array('id' => 'content_none_title', 'title' => __('Content None Title', 'hocwp-theme')));
$excerpt_length = hocwp_get_value_by_key($options, 'excerpt_length');
$option->add_field(array('id' => 'excerpt_length', 'title' => __('Excerpt Length', 'hocwp-theme'), 'field_callback' => 'hocwp_field_input_number', 'value' => $excerpt_length));
if (hocwp_wc_installed() || hocwp_is_shop_site()) {
    $value = hocwp_get_product_posts_per_page();
    $option->add_field(array('id' => 'products_per_page', 'title' => __('Product Each Page', 'hocwp-theme'), 'field_callback' => 'hocwp_field_input_number', 'value' => $value));
}
$option->add_section(array('id' => 'breadcrumb', 'title' => __('Breadcrumb', 'hocwp-theme'), 'description' => __('Custom breadcrumb on your site.', 'hocwp-theme')));
$option->add_field(array('id' => 'breadcrumb_label', 'title' => __('Breadcrumb Label', 'hocwp-theme'), 'value' => hocwp_wpseo_internallink_value('breadcrumbs-prefix'), 'section' => 'breadcrumb'));
$option->add_field(array('id' => 'disable_post_title_breadcrumb', 'title' => __('Disable Post Title', 'hocwp-theme'), 'field_callback' => 'hocwp_field_input_checkbox', 'label' => __('Prevent post title to be shown on last item.', 'hocwp-theme'), 'section' => 'breadcrumb'));
$option->add_field(array('id' => 'link_last_item_breadcrumb', 'title' => __('Link Last Item', 'hocwp-theme'), 'field_callback' => 'hocwp_field_input_checkbox', 'label' => __('Add link to last item instead of text.', 'hocwp-theme'), 'section' => 'breadcrumb'));
$thumbnail_image_sizes = $options['thumbnail_image_sizes'];
$thumbnail_image_sizes = apply_filters('hocwp_thumbnail_image_sizes', $thumbnail_image_sizes);
$thumbnail_image_sizes = hocwp_sanitize_array($thumbnail_image_sizes);
if (hocwp_array_has_value($thumbnail_image_sizes)) {
    $option->add_section(array('id' => 'thumbnail_images', 'title' => __('Thumbnail Images', 'hocwp-theme'), 'description' => __('These settings affect the display and dimensions of images in your catalog – the display on the front-end will still be affected by CSS styles.', 'hocwp-theme')));
    foreach ($thumbnail_image_sizes as $thumbnail_size) {
        $thumbnail_size['section'] = 'thumbnail_images';
        $thumbnail_size['field_callback'] = 'hocwp_field_size';
Пример #10
0
function hocwp_breadcrumb($args = array())
{
    if (is_home()) {
        return;
    }
    $before = hocwp_get_value_by_key($args, 'before');
    $after = hocwp_get_value_by_key($args, 'after');
    if (function_exists('yoast_breadcrumb') && hocwp_wpseo_breadcrumb_enabled()) {
        yoast_breadcrumb('<nav class="hocwp-breadcrumb breadcrumb yoast clearfix">' . $before, $after . '</nav>');
        return;
    }
    if (hocwp_wc_installed()) {
        if (empty($before)) {
            $before = '<div class="hocwp-breadcrumb breadcrumb">';
            $after = '</div>';
        }
        echo $before;
        woocommerce_breadcrumb($args);
        echo $after;
        return;
    }
    global $post;
    $separator = isset($args['separator']) ? $args['separator'] : '/';
    $breadcrums_id = isset($args['id']) ? $args['id'] : 'hocwp_breadcrumbs';
    $home_title = __('Home', 'hocwp-theme');
    $custom_taxonomy = 'product_cat';
    $class = isset($args['class']) ? $args['class'] : '';
    $class = hocwp_add_string_with_space_before($class, 'list-inline list-unstyled breadcrumbs');
    if (!is_front_page()) {
        echo '<div class="hocwp-breadcrumb breadcrumb default clearfix">';
        echo '<ul id="' . $breadcrums_id . '" class="' . $class . '">';
        echo '<li class="item-home"><a class="bread-link bread-home" href="' . get_home_url() . '" title="' . $home_title . '">' . $home_title . '</a></li>';
        echo '<li class="separator separator-home"> ' . $separator . ' </li>';
        if (is_post_type_archive()) {
            echo '<li class="item-current item-archive"><strong class="bread-current bread-archive">' . post_type_archive_title('', false) . '</strong></li>';
        } elseif (is_archive() && is_tax() && !is_category()) {
            $post_type = get_post_type();
            if ($post_type != 'post') {
                $post_type_object = get_post_type_object($post_type);
                $post_type_archive = get_post_type_archive_link($post_type);
                if (is_object($post_type_object)) {
                    echo '<li class="item-cat item-custom-post-type-' . $post_type . '"><a class="bread-cat bread-custom-post-type-' . $post_type . '" href="' . $post_type_archive . '" title="' . $post_type_object->labels->name . '">' . $post_type_object->labels->name . '</a></li>';
                    echo '<li class="separator"> ' . $separator . ' </li>';
                }
            }
            if (is_search()) {
                echo '<li class="item-current item-current-' . get_search_query() . '"><strong class="bread-current bread-current-' . get_search_query() . '" title="Search results for: ' . get_search_query() . '">Search results for: ' . get_search_query() . '</strong></li>';
            } else {
                $custom_tax_name = get_queried_object()->name;
                echo '<li class="item-current item-archive"><strong class="bread-current bread-archive">' . $custom_tax_name . '</strong></li>';
            }
        } elseif (is_single()) {
            $post_type = get_post_type();
            if ($post_type != 'post') {
                $post_type_object = get_post_type_object($post_type);
                $post_type_archive = get_post_type_archive_link($post_type);
                echo '<li class="item-cat item-custom-post-type-' . $post_type . '"><a class="bread-cat bread-custom-post-type-' . $post_type . '" href="' . $post_type_archive . '" title="' . $post_type_object->labels->name . '">' . $post_type_object->labels->name . '</a></li>';
                echo '<li class="separator"> ' . $separator . ' </li>';
            }
            $category = get_the_category();
            $array_values = array_values($category);
            $last_category = end($array_values);
            $get_cat_parents = '';
            if (is_object($last_category)) {
                $get_cat_parents = rtrim(get_category_parents($last_category->term_id, true, ','), ',');
            }
            $cat_parents = explode(',', $get_cat_parents);
            $cat_display = '';
            foreach ($cat_parents as $parents) {
                $cat_display .= '<li class="item-cat">' . $parents . '</li>';
                $cat_display .= '<li class="separator"> ' . $separator . ' </li>';
            }
            $taxonomy_exists = taxonomy_exists($custom_taxonomy);
            if (empty($last_category) && !empty($custom_taxonomy) && $taxonomy_exists) {
                $taxonomy_terms = get_the_terms($post->ID, $custom_taxonomy);
                if (isset($taxonomy_terms[0]) && is_a($taxonomy_terms[0], 'WP_Term')) {
                    $cat_id = $taxonomy_terms[0]->term_id;
                    $cat_nicename = $taxonomy_terms[0]->slug;
                    $cat_link = get_term_link($taxonomy_terms[0]->term_id, $custom_taxonomy);
                    $cat_name = $taxonomy_terms[0]->name;
                }
            }
            if (!empty($last_category)) {
                echo $cat_display;
                echo '<li class="item-current item-' . $post->ID . '"><strong class="bread-current bread-' . $post->ID . '" title="' . get_the_title() . '">' . get_the_title() . '</strong></li>';
            } elseif (!empty($cat_id)) {
                echo '<li class="item-cat item-cat-' . $cat_id . ' item-cat-' . $cat_nicename . '"><a class="bread-cat bread-cat-' . $cat_id . ' bread-cat-' . $cat_nicename . '" href="' . $cat_link . '" title="' . $cat_name . '">' . $cat_name . '</a></li>';
                echo '<li class="separator"> ' . $separator . ' </li>';
                echo '<li class="item-current item-' . $post->ID . '"><strong class="bread-current bread-' . $post->ID . '" title="' . get_the_title() . '">' . get_the_title() . '</strong></li>';
            } else {
                echo '<li class="item-current item-' . $post->ID . '"><strong class="bread-current bread-' . $post->ID . '" title="' . get_the_title() . '">' . get_the_title() . '</strong></li>';
            }
        } elseif (is_category()) {
            echo '<li class="item-current item-cat"><strong class="bread-current bread-cat">' . single_cat_title('', false) . '</strong></li>';
        } elseif (is_page()) {
            if ($post->post_parent) {
                $anc = get_post_ancestors($post->ID);
                $anc = array_reverse($anc);
                $anc = array_reverse($anc);
                $parents = '';
                foreach ($anc as $ancestor) {
                    $parents .= '<li class="item-parent item-parent-' . $ancestor . '"><a class="bread-parent bread-parent-' . $ancestor . '" href="' . get_permalink($ancestor) . '" title="' . get_the_title($ancestor) . '">' . get_the_title($ancestor) . '</a></li>';
                    $parents .= '<li class="separator separator-' . $ancestor . '"> ' . $separator . ' </li>';
                }
                echo $parents;
                echo '<li class="item-current item-' . $post->ID . '"><strong title="' . get_the_title() . '"> ' . get_the_title() . '</strong></li>';
            } else {
                echo '<li class="item-current item-' . $post->ID . '"><strong class="bread-current bread-' . $post->ID . '"> ' . get_the_title() . '</strong></li>';
            }
        } elseif (is_tag()) {
            $term_id = get_query_var('tag_id');
            $taxonomy = 'post_tag';
            $args = 'include=' . $term_id;
            $terms = hocwp_get_terms($taxonomy, $args);
            if (hocwp_array_has_value($terms)) {
                echo '<li class="item-current item-tag-' . $terms[0]->term_id . ' item-tag-' . $terms[0]->slug . '"><strong class="bread-current bread-tag-' . $terms[0]->term_id . ' bread-tag-' . $terms[0]->slug . '">' . $terms[0]->name . '</strong></li>';
            }
        } elseif (is_day()) {
            echo '<li class="item-year item-year-' . get_the_time('Y') . '"><a class="bread-year bread-year-' . get_the_time('Y') . '" href="' . get_year_link(get_the_time('Y')) . '" title="' . get_the_time('Y') . '">' . get_the_time('Y') . ' Archives</a></li>';
            echo '<li class="separator separator-' . get_the_time('Y') . '"> ' . $separator . ' </li>';
            echo '<li class="item-month item-month-' . get_the_time('m') . '"><a class="bread-month bread-month-' . get_the_time('m') . '" href="' . get_month_link(get_the_time('Y'), get_the_time('m')) . '" title="' . get_the_time('M') . '">' . get_the_time('M') . ' Archives</a></li>';
            echo '<li class="separator separator-' . get_the_time('m') . '"> ' . $separator . ' </li>';
            echo '<li class="item-current item-' . get_the_time('j') . '"><strong class="bread-current bread-' . get_the_time('j') . '"> ' . get_the_time('jS') . ' ' . get_the_time('M') . ' Archives</strong></li>';
        } elseif (is_month()) {
            echo '<li class="item-year item-year-' . get_the_time('Y') . '"><a class="bread-year bread-year-' . get_the_time('Y') . '" href="' . get_year_link(get_the_time('Y')) . '" title="' . get_the_time('Y') . '">' . get_the_time('Y') . ' Archives</a></li>';
            echo '<li class="separator separator-' . get_the_time('Y') . '"> ' . $separator . ' </li>';
            echo '<li class="item-month item-month-' . get_the_time('m') . '"><strong class="bread-month bread-month-' . get_the_time('m') . '" title="' . get_the_time('M') . '">' . get_the_time('M') . ' Archives</strong></li>';
        } elseif (is_year()) {
            echo '<li class="item-current item-current-' . get_the_time('Y') . '"><strong class="bread-current bread-current-' . get_the_time('Y') . '" title="' . get_the_time('Y') . '">' . get_the_time('Y') . ' Archives</strong></li>';
        } elseif (is_author()) {
            global $author;
            $userdata = get_userdata($author);
            echo '<li class="item-current item-current-' . $userdata->user_nicename . '"><strong class="bread-current bread-current-' . $userdata->user_nicename . '" title="' . $userdata->display_name . '">' . 'Author: ' . $userdata->display_name . '</strong></li>';
        } elseif (get_query_var('paged')) {
            echo '<li class="item-current item-current-' . get_query_var('paged') . '"><strong class="bread-current bread-current-' . get_query_var('paged') . '" title="Page ' . get_query_var('paged') . '">' . __('Page') . ' ' . get_query_var('paged') . '</strong></li>';
        } elseif (is_search()) {
            echo '<li class="item-current item-current-' . get_search_query() . '"><strong class="bread-current bread-current-' . get_search_query() . '" title="Search results for: ' . get_search_query() . '">Search results for: ' . get_search_query() . '</strong></li>';
        } elseif (is_404()) {
            echo '<li>' . __('Error 404', 'hocwp-theme') . '</li>';
        }
        echo '</ul>';
        echo '</div>';
    }
}