This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| get_header(); | |
| ?> | |
| <div class="bg--archive"> | |
| <section class="breadcum"> | |
| <div class="container"> | |
| <?php if (function_exists('rank_math_the_breadcrumbs')) rank_math_the_breadcrumbs(); ?> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --------------tỉnh thành | |
| <section class="category-section pb-4 mb-5"> | |
| <div class="container"> | |
| <div class="row"> | |
| <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12"> | |
| <div class="single-content"> | |
| <h1><?php the_title(); ?></h1> | |
| <div class="content-text"> | |
| <div class="chot-maps"> | |
| <div class="sidebar-map"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <a class="social-share-item hover-opacity-80 bg-social-zalo" href="https://zalo.me/share?url=<?php echo get_permalink($product->get_id()); ?>" rel="noopener noreferrer nofollow" target="_blank" aria-label="Chia sẻ qua Zalo"> | |
| <div class="share--single d-flex"> | |
| <a href="https://www.facebook.com/sharer.php?u=<?php echo get_permalink(); ?>" data-label="Facebook" onclick="window.open(this.href,this.title,'width=500,height=500,top=300px,left=300px'); return false;" rel="noopener noreferrer nofollow" target="_blank" aria-label="Chia sẻ trên Facebook"> | |
| <i class="fa-brands fa-facebook-f"></i> | |
| </a> | |
| <a href="https://twitter.com/share?url=<?php echo get_permalink(); ?>" data-label="Twitter" onclick="window.open(this.href,this.title,'width=500,height=500,top=300px,left=300px'); return false;" rel="noopener noreferrer nofollow" target="_blank" aria-label="Chia sẻ trên Twitter"> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="lienquan--single"> | |
| <h3>Tin liên quan</h3> | |
| <?php | |
| $categories = get_the_category($post->ID); | |
| if ($categories) { | |
| $category_ids = array(); | |
| foreach ($categories as $individual_category) $category_ids[] = $individual_category->term_id; | |
| $args = array( | |
| 'category__in' => $category_ids, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // thên .html product | |
| /** Đoạn code thêm đuôi .html vào cuối sản phẩm **/ | |
| function codfe_product_permastruct_html($post_type, $args) | |
| { | |
| if ($post_type === 'product') | |
| add_permastruct($post_type, "{$args->rewrite['slug']}/%$post_type%.html", $args->rewrite); | |
| } | |
| add_action('registered_post_type', 'codfe_product_permastruct_html', 10, 2); | |
| //loại bỏ product | |
| function devvn_remove_slug($post_link, $post) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cấu hình woocommerce\single-product\add-to-cart\simple.php | |
| bỏ code add to cart bằng mua ngay | |
| <button type="submit" name="buy-now" value="<?php echo esc_attr($product_id); ?>" class="single_add_to_cart_button button buy_now_button button alt<?php echo esc_attr(wc_wp_theme_get_element_class_name('button') ? ' ' . wc_wp_theme_get_element_class_name('button') : ''); ?>"><?php echo esc_html__('Mua ngay', 'your-text-domain'); ?></button> | |
| <?php do_action('woocommerce_after_add_to_cart_button'); ?> | |
| <?php else : ?> | |
| <p><?php esc_html_e('Có lỗi xảy ra khi thêm sản phẩm vào giỏ hàng. Vui lòng thử lại sau.', 'your-text-domain'); ?></p> | |
| <?php endif; ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="card-body"> | |
| <a href="<?php the_permalink(); ?>"> | |
| <p class="card-title "><?php echo the_title(); ?></p> | |
| </a> | |
| <div class="price-wrapper"> | |
| <div class="devvn_product_price"> | |
| <span class="price"> | |
| <?php | |
| // Kiểm tra xem sản phẩm có phải là biến thể hay không | |
| if ($product->is_type('variable')) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class Featured_Post { | |
| var $db = NULL; | |
| public $post_types = array(); | |
| function __construct() { | |
| add_action('init', array(&$this, | |
| 'init' | |
| )); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php $args = array( | |
| 'post_type' => 'post', | |
| 'posts_per_page' => 10, | |
| 'post_status' => 'publish', | |
| 'meta_query' => array( | |
| array( | |
| 'key' => '_is_featured', | |
| 'value' => 'yes' | |
| ) | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| case 'price': // Đổi price thành trường bạn muốn hiển thị giá | |
| // Thêm mã PHP để hiển thị giá ở đây | |
| // Ví dụ: | |
| $regular_price = $product->get_regular_price(); | |
| $sale_price = $product->get_sale_price(); | |
| if ($sale_price) { | |
| $discount_percentage = (($regular_price - $sale_price) / $regular_price) * 100; | |
| echo '<div class="d-flex justify-content-center align-items-center" > <span class="gia--cu"><del>' . wc_price($regular_price) . '</del></span>'; | |
| echo '<span class="km-pt" style="color: #e00;padding-left: 5px;">' . '-' . round($discount_percentage) . '%</span></div>'; | |
| echo '<span class="gia--moi" style=" display:block;margin-left:-35px;color: #e00;font-weight: 700;">' . wc_price($sale_price) . '</span>'; |
NewerOlder