__('No Repeat','ecommerce-star'), 'repeat' => __('Tile','ecommerce-star'), 'repeat-x' => __('Tile Horizontally','ecommerce-star'), 'repeat-y' => __('Tile Vertically','ecommerce-star'), ); } endif; if ( ! function_exists( 'ecommerce_star_get_index_page_id' ) ) : /** * Get front index page ID. * @param string $type Type. * @return int Corresponding Page ID. */ function ecommerce_star_get_index_page_id( $type = 'front' ) { $page = ''; switch ( $type ) { case 'front': $page = get_option( 'page_on_front' ); break; case 'blog': $page = get_option( 'page_for_posts' ); break; default: break; } $page = absint( $page ); return $page; } endif; if ( ! function_exists( 'ecommerce_star_customize_page_title' ) ) : /** * Add title in Custom Header. * @since 1.0 * * @param string $title Title. * @return string Modified title. */ function ecommerce_star_customize_page_title( $title = '' ) { if ( is_home() && ( $blog_page_id = ecommerce_star_get_index_page_id( 'blog' ) ) > 0 ) { $title = get_the_title( $blog_page_id ); } elseif ( is_singular() ) { $title = get_the_title(); } elseif ( is_archive() ) { $title = strip_tags( get_the_archive_title() ); } elseif ( is_search() ) { /* translators: %s: search query input */ $title = sprintf( __( 'Search Results for: %s', 'ecommerce-star' ), get_search_query() ); } elseif ( is_404() ) { $title = __( '404!', 'ecommerce-star' ); } return $title; } endif; if ( ! function_exists( 'ecommerce_star_custom_fonts_css' ) ) : /** * ecommerce-star google font css */ function ecommerce_star_custom_fonts_css() { global $ecommerce_star_option; if ( class_exists( 'WP_Customize_Control' ) ) { $ecommerce_star_option = wp_parse_args( get_option( 'ecommerce_star_option', array() ) , ecommerce_star_settings()); } $css =' h1 , h2 , h3 , h4 , h5 , h6 , .entry-title , .page-title , .entry-meta , .callout-title , .entry-meta a { font-family:'.$ecommerce_star_option['header_fontfamily'].',sans serif; } html { font-family:'.$ecommerce_star_option['body_fontfamily'].',sans serif; } .main-navigation { font-family:'.$ecommerce_star_option['header_fontfamily'].',sans serif; } .site-title a, .testimonial-title { font-family:'.$ecommerce_star_option['header_fontfamily'].',sans serif; } #main_Carousel .slider-title { font-family:'.$ecommerce_star_option['header_fontfamily'].',sans serif; } '; return $css; } endif; if ( ! function_exists( 'ecommerce_star_posted_on' ) ) : /** * Prints HTML with meta information for the current post-date/time and author. */ function ecommerce_star_posted_on() { $byline = sprintf( // Get the author name; wrap it in a link. esc_html_x( 'By %s', 'post author', 'ecommerce-star' ), '' . ecommerce_star_time_link() . ' '; } endif; if ( ! function_exists( 'ecommerce_star_time_link' ) ) : /** * Gets a nicely formatted string for the published date. */ function ecommerce_star_time_link() { $time_string = ''; if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string = ''; } $time_string = sprintf( $time_string, get_the_date( DATE_W3C ), get_the_date(), get_the_modified_date( DATE_W3C ), get_the_modified_date() ); $args = array( 'time'=> array('class'=> array(),'datetime'=>array())); // Wrap the time string in a link, and preface it with 'Posted on'. return sprintf( /* translators: %s: post date */ __( '%1$s %2$s', 'ecommerce-star' ), esc_html__('Posted on', 'ecommerce-star'), '' . wp_kses($time_string, $args) . '' ); } endif; if ( ! function_exists( 'ecommerce_star_entry_footer' ) ) : /** * Prints HTML with meta information for the categories, tags and comments. */ function ecommerce_star_entry_footer() { /* translators: used between list items, there is a space after the comma */ $separate_meta = __( ', ', 'ecommerce-star' ); // Get Categories for posts. $categories_list = get_the_category_list( $separate_meta ); // Get Tags for posts. $tags_list = get_the_tag_list( '', $separate_meta ); // We don't want to output .entry-footer if it will be empty, so make sure its not. if ( ( ( ecommerce_star_categorized_blog() && $categories_list ) || $tags_list ) || get_edit_post_link() ) { echo ' '; } } endif; if ( ! function_exists( 'ecommerce_star_edit_link' ) ) : /** * Returns an accessibility-friendly link to edit a post or page. * Helpful when/if the single-page * layout with multiple posts/pages shown gets confusing. */ function ecommerce_star_edit_link() { edit_post_link( sprintf( /* translators: %s: Name of current post */ __( 'Edit "%s"', 'ecommerce-star' ), esc_html(get_the_title()) ), ' ', '' ); } endif; /** * Change View cart text */ function ecommerce_star_view_cart_strings( $translated_text, $text, $domain ) { switch ( $translated_text ) { case 'View cart' : $translated_text = __( 'View', 'ecommerce-star' ); break; } return $translated_text; } add_filter( 'gettext', 'ecommerce_star_view_cart_strings', 20, 3 ); /** * Woocommerce Custom add to wishlist button * */ if ( ! function_exists( 'ecommerce_star_wishlist' ) ) { function ecommerce_star_wishlist() { if(!class_exists( 'WooCommerce' )){return;} global $product; if( function_exists( 'YITH_WCWL' ) ){ $wishlist_url = add_query_arg( 'add_to_wishlist', $product->get_id() ); ?> get_type(); } else { $prod_type = $product->product_type; } if ( function_exists( 'method_exists' ) && method_exists( $product, 'get_stock_status' ) ) { $prod_in_stock = $product->get_stock_status(); } else { $prod_in_stock = $product->is_in_stock(); } if ( $product ) { $args = array(); $defaults = array( 'quantity' => 1, 'class' => implode( ' ', array_filter( array('button', 'product_type_' . $prod_type, $product->is_purchasable() && $prod_in_stock ? 'add_to_cart_button' : '', $product->supports( 'ajax_add_to_cart' ) ? 'ajax_add_to_cart' : '',) ) ), ); $args = apply_filters( 'woocommerce_loop_add_to_cart_args', wp_parse_args( $args, $defaults ), $product ); if(locate_template('woocommerce/add-to-cart.php')){ wc_get_template( 'woocommerce/add-to-cart.php', $args ); } } } } /** * Add Cart icon and count to header if WC is active */ function ecommerce_star_wc_cart_count() { if (!class_exists('WooCommerce')) return; global $woocommerce; ?> cart->cart_contents_count); ?> cart->get_cart_total()); ?> cart->cart_contents_count); ?> cart->get_cart_total()); ?>
' ); // Finally, let's write all of this to the page. echo '
|
|