Author Archives: vntopno1

Làm chủ contact form 7

Thay icon datetime picker input[type=”date”]::-webkit-calendar-picker-indicator { color: rgba(0, 0, 0, 0); opacity: 1; display: block; background: url(https://autoshop.com.vn/wp-content/uploads/2022/10/calendar.png) no-repeat; background-size:cover; width: 22px; height: 25px; border-width: thin; } hiển thị placeholder datetime picker .wpcf7 input[type=”date”]:before { content: attr(placeholder); }

Custom Đánh giá woocommerce

Bỏ vào File Function.php function addstar_pttuan(){ if ( is_singular( ‘product’ ) ) { global $product; $rating_arr = $product->get_rating_counts(); $review_count = $product->get_rating_count(); $countstar = $product->get_average_rating(); if($countstar==’0′){$countstar = ‘Chưa có đánh giá’;}?> <div class=”rating-table row row-small align-middle”> <div class=”rating-table__total col large-4 small-12 medium-12″> <div class=”title-rating”>Điểm đánh giá trung bình</div> <div class=”rating_total”><?php echo $countstar;?></div> <div class=”star-rating-custom”><?php echo wc_get_rating_html(…

Thủ Thuật CSS

/* cách đổi màu file ảnh SVG nhúng trực tiếp trong thẻ img src https://codepen.io/sosuke/pen/Pjoqqp link đổi màu từ rgb sang filter */ .tenclass-svg{ filter: invert(100%) sepia(0%) saturate(7457%) hue-rotate(302deg) brightness(117%) contrast(91%); }

Posted in CSS

Chuyển Mô tả Danh mục sản phẩm từ đầu trang xuống cuối trang

Thêm code này vào function.php trong theme wordpress add_action( ‘wp’, ‘tu_move_wc_archive_description’ ); function tu_move_wc_archive_description() { if ( is_archive() ) { remove_action( ‘woocommerce_archive_description’, ‘woocommerce_taxonomy_archive_description’, 10 ); remove_action( ‘woocommerce_archive_description’, ‘woocommerce_product_archive_description’, 10 ); add_action( ‘woocommerce_after_main_content’, ‘woocommerce_taxonomy_archive_description’, 10 ); add_action( ‘woocommerce_after_main_content’, ‘woocommerce_product_archive_description’, 10 ); } }

Đổi thông báo email cho user đăng ký mới – WordPress

add_filter( ‘wp_new_user_notification_email’, ‘custom_wp_new_user_notification_email’, 10, 3 ); function custom_wp_new_user_notification_email( $wp_new_user_notification_email, $user, $blogname, $plaintext_pass=” ) { $key = get_password_reset_key( $user ); if ( is_wp_error( $key ) ) { return; } $wp_new_user_notification_email[‘subject’] = sprintf( ‘[%s] New user %s registered.’, $blogname, $user->user_login ); $wp_new_user_notification_email[‘message’] = sprintf( “Chào mừng bạn đến với Hệ thống Giáo dục DoCom. Tài khoản của…

Những đoạn code làm chủ Woocommerce

// Reorder product tab woocommerce add_filter( ‘woocommerce_product_tabs’, ‘woo_reorder_tabs’, 98 ); function woo_reorder_tabs( $tabs ) { $tabs[‘reviews’][‘priority’] = 5; // Reviews first $tabs[‘description’][‘priority’] = 10; // Description second $tabs[‘additional_information’][‘priority’] = 15; // Additional information third return $tabs; } // Đổi tên và ẩn product tabs add_filter( ‘woocommerce_product_tabs’, ‘woo_remove_product_tabs’, 98 ); function woo_remove_product_tabs( $tabs ) { $tabs[‘description’][‘title’]…

Shortcode hay cho wordpress

  // Lấy tất cả attribute của sản phẩm ngoại trừ trong if add_shortcode(‘fv_tour_att’,’fv_tour_att’); function fv_tour_att() { $output = ‘<ul style=”list-style:none;”>’; foreach( wc_get_attribute_taxonomies() as $attribute ) { $taxonomy = ‘pa_’ . $attribute->attribute_name; $term_names = get_terms( array( ‘taxonomy’ => $taxonomy, ‘fields’ => ‘names’ ) ); if( ($taxonomy == ‘pa_duration’) || ($taxonomy == ‘pa_tour-type’) || ($taxonomy ==…

Thêm Nút mua ngay trên theme flatsome – Thủ Thuật WordPress

Thêm Nút mua ngay trên theme flatsome sử dụng plugin mua ngay add_action(‘flatsome_product_box_after’,’fv_view_more_btn’); function fv_view_more_btn(){ global $product; $fvproductid = $product->get_id(); echo ‘<div class=”right”>’; echo do_shortcode(‘[devvn_quickbuy id=”‘.$fvproductid.'”]’); echo ‘</div>’; }