Category : Akasa Code WP

1.Form Giỏ hàng [woocommerce_cart] 2. Form thanh toán [woocommerce_checkout] Form tài khoản [woocommerce_my_account] form track order [woocommerce_order_tracking] Sản phẩm nổi bật [featured_products] Sản phẩm khuyến mãi [sale_products] Các Sản Phẩm Bán Chạy Nhất [best_selling_products] Sản phẩm mới [recent_products] sản phẩm liên quan [related_products] Sản phẩm bình chọn tốt nhất [top_rated_products] Sẽ hiển thị các sản ..

Read more

Code hiện thị <div class=”col-12 col-sm-12 col-md-12 ajax-content-cat”> <div class=”col-box-items-blogs”> <div class=”row”> <div class=”col-12 col-sm-12 col-md-6″> <div class=”aaaalkll-left”> <?php $wp1 = new WP_Query(array( ‘post_type’=>’post’, ‘post_status’=>’publish’, ‘cat’ => $cat, ‘posts_per_page’=> 1)); while ($wp1->have_posts()) : $wp1->the_post(); ?> <div class=”img-title-category-templates”> <div class=”img-category-templates position-relative”> <a href=”<?php the_permalink();?>”><?php the_post_thumbnail(‘full’);?></a> <span class=”position-absolute”><?php the_category();?></span> </div> <div class=”title-category-templates”> <a href=”<?php the_permalink();?>”><?php the_title();?></a> <div ..

Read more

Đây là ví dụ tạo widget hiển thị bài viết ngẫu nhiên class Random_Post extends WP_Widget { function __construct() { parent::__construct( ‘random_post’, ‘Bài ngẫu nhiên’, array( ‘description’ => ‘Widget hiển thị bài viết ngẫu nhiên’ ) ); } function form( $instance ) { $default = array( ‘title’ => ‘Tiêu đề widget’, ‘post_number’ => 10 ); ..

Read more

add_filter(‘acf/settings/path’, ‘my_acf_settings_path’); function my_acf_settings_path( $path ) { // update path $path = get_stylesheet_directory() . ‘/acf/’; return $path; } // 2. customize ACF dir add_filter(‘acf/settings/dir’, ‘my_acf_settings_dir’); function my_acf_settings_dir( $dir ) { // update path $dir = get_stylesheet_directory_uri() . ‘/acf/’; // return return $dir; } // 3. Ẩn Acf menu admin add_filter(‘acf/settings/show_admin’, ‘__return_false’); // 4. Include ACF ..

Read more

//Shop URL $shop_page_url = get_permalink( woocommerce_get_page_id( ‘shop’ ) ) //My Account URL $myaccount_page_id = get_option( ‘woocommerce_myaccount_page_id’ ); if ( $myaccount_page_id ) { $myaccount_page_url = get_permalink( $myaccount_page_id ); } //Cart URL global $woocommerce; $cart_url = $woocommerce->cart->get_cart_url(); //Checkout URL global $woocommerce; $checkout_url = $woocommerce->cart->get_checkout_url(); //Payment Page URL $payment_page = get_permalink( woocommerce_get_page_id( ‘pay’ ) ); if ( get_option( ..

Read more

function grd_woocommerce_script_cleaner() { remove_action( ‘wp_head’, array( $GLOBALS[‘woocommerce’], ‘generator’ ) ); if ( ! is_admin()) { wp_dequeue_style( ‘woocommerce_frontend_styles’ ); wp_dequeue_style( ‘woocommerce-general’); wp_dequeue_style( ‘woocommerce-layout’ ); wp_dequeue_style( ‘woocommerce-smallscreen’ ); wp_dequeue_style( ‘woocommerce_fancybox_styles’ ); wp_dequeue_style( ‘woocommerce_chosen_styles’ ); wp_dequeue_style( ‘woocommerce_prettyPhoto_css’ ); wp_dequeue_style( ‘select2’ ); wp_dequeue_script( ‘wc-add-payment-method’ ); wp_dequeue_script( ‘wc-lost-password’ ); wp_dequeue_script( ‘wc_price_slider’ ); wp_dequeue_script( ‘wc-single-product’ ); wp_dequeue_script( ‘wc-add-to-cart’ ); wp_dequeue_script( ‘wc-cart-fragments’ ..

Read more

add_filter( ‘woocommerce_checkout_fields’ , ‘custom_override_checkout_fields’ ); function custom_override_checkout_fields( $fields ) { unset($fields[‘billing’][‘billing_first_name’]); unset($fields[‘billing’][‘billing_last_name’]); unset($fields[‘billing’][‘billing_company’]); unset($fields[‘billing’][‘billing_address_1’]); unset($fields[‘billing’][‘billing_address_2’]); unset($fields[‘billing’][‘billing_city’]); unset($fields[‘billing’][‘billing_postcode’]); unset($fields[‘billing’][‘billing_country’]); unset($fields[‘billing’][‘billing_state’]); unset($fields[‘billing’][‘billing_phone’]); unset($fields[‘order’][‘order_comments’]); unset($fields[‘billing’][‘billing_address_2’]); unset($fields[‘billing’][‘billing_postcode’]); unset($fields[‘billing’][‘billing_company’]); unset($fields[‘billing’][‘billing_last_name’]); unset($fields[‘billing’][‘billing_email’]); unset($fields[‘billing’][‘billing_city’]); return $..

Read more