Cho phép lựa chọn giao diện hiển thị khác nhau trên page 1. Code riêng giao diện cho 1 page theo ID hoặc url, VD: page-catalogue-hupuna.php hoặc page-4281.php, có định dạng là page-{slug}.php page-{ID}.php 2. Tạo template riêng, vẫn tạo file page-tenriengtemplate.php, sau đó chèn đoạn sau vào đầu file: /** * Template Name: My ..
Category : Wordpress
<?php // Display variations dropdowns on shop page for variable products add_filter( 'woocommerce_loop_add_to_cart_link', 'woo_display_variation_dropdown_on_shop_page' ); function woo_display_variation_dropdown_on_shop_page() { global $product; if( $product->is_type( 'variable' )) { $attribute_keys = array_keys( $product->get_attributes() ); ?> <form class="variations_form cart" method="post" enctype='multipart/form-data' data-product_id="<?php echo absint( $product->id ); ?>" data-product_variations="<?php echo htmlspecialchars( json_encode( $product->get_available_variations() ) ) ?>"> <?php do_action( 'woocommerce_before_variations_form' ); ?> ..
Cài bản free, bấm kích hoạt mới, truy cập vào trang chủ chọn gói free, nhập mail để nhận kích hoạt, sau đó cài đè bả..
Xem thêm tại: https://www.sitepoint.com/customizing-wordpress-oembed-content/ Hoặc bài khác: https://www.smashingmagazine.com/2012/11/embeddable-content-..
Đôi khi trong soạn thảo bài viết, cỡ chữ mặc định khá nhỏ, màu mờ gây khó nhìn. Vậy nên ta css để chữ to lên, màu sắc đậm thêm đoạn sau vào funtion // add css backend editor cho dễ dùng add_action( 'after_setup_theme', 'generate_child_setup' ); function generate_child_setup() { add_editor_style( 'editor-style.css' ); } Sau đó ..
Cụ thể đổi thẻ h2 xang h3 remove_action( ‘woocommerce_shop_loop_item_title’,’woocommerce_template_loop_product_title’, 10 ); add_action(‘woocommerce_shop_loop_item_title’, ‘abChangeProductsTitle’, 10 ); function abChangeProductsTitle() { echo ‘<h3 class=”woocommerce-loop-product_title”>’ . get_the_title() . ‘</h3>’; } tham khảo: https://stackoverflow.com/questions/50979203/how-can-i-change-the-product-h2-in-woocommerce-storef..
Thêm đoạn sau vào funtion theme remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 ); add_action( 'woocommerce_after_shop_loop', 'woocommerce_taxonomy_archive_description..
https://www.tychesoftwares.com/how-to-add-plus-and-minus-buttons-to-the-quantity-input-on-the-product-page-in-wo..
add_action( 'after_setup_theme', 'setup_woocommerce_support' ); function setup_woocommerce_support() { add_theme_support('woocommerce'); } Nguồn: https://wordpress.stackexchange.com/questions/90199/how-to-declare-woocommerce-support-in-your-theme Hoặc đoạn đầy đủ dưới: // add theme suport WooCommerce function akasa_theme_setup() { // WooCommerce in general. add_theme_support( 'woocommerce' ); // Enabling WooCommerce product gallery features (are off by default since WC 3.0.0). // zoom. add_theme_support( 'wc-product-gallery-zoom' ); // lightbox. add_theme_support( 'wc-product-gallery-lightbox' ); // ..
Thêm vào wp-config.php if ( !defined('ABSPATH') ) define('ABSPATH', dirname(__FILE__) . '/'); define ('WP_CONTENT_FOLDERNAME', 'frontend'); define ('WP_CONTENT_DIR', ABSPATH . WP_CONTENT_FOLDERNAME) ; define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/'); define('WP_CONTENT_URL', WP_SITEURL . WP_CONTENT_FOLDERNAME); define( 'WP_PLUGIN_DIR', dirname(__FILE__) . '/plugins' ); define( 'WP_PLUGIN_URL', 'http://' . $_SERVER['HTTP_HOST'] . '/plugins' ); define('DISALLOW_FILE_EDIT', true); /** Sets up WordPress vars and included files. */ ..
Phản hồi