• Về minhduy.vn
  • Đăng ký Hosting
  • Thiết kế Website
  • Khuyến mãi HOT
Hướng Dẫn Sử Dụng Dịch Vụ - Minh Duy Solutions
  • Trang chủ
  • Hosting
    • Hướng dẫn Hosting cPanel
    • Hướng dẫn Hosting DirectAdmin
  • Tên miền
  • Website
    • Hướng dẫn WordPress
    • Hướng dẫn Webmaster
  • Email Doanh Nghiệp
    • Office 365
    • Google Work Space
    • Email Zimbra
  • VPS – Máy chủ
    • Hướng dẫn Linux
    • Hướng dẫn DirectAdmin
  • Hướng dẫn chung
  • Góc ICT
No Result
View All Result
  • Trang chủ
  • Hosting
    • Hướng dẫn Hosting cPanel
    • Hướng dẫn Hosting DirectAdmin
  • Tên miền
  • Website
    • Hướng dẫn WordPress
    • Hướng dẫn Webmaster
  • Email Doanh Nghiệp
    • Office 365
    • Google Work Space
    • Email Zimbra
  • VPS – Máy chủ
    • Hướng dẫn Linux
    • Hướng dẫn DirectAdmin
  • Hướng dẫn chung
  • Góc ICT
No Result
View All Result
Hướng Dẫn Sử Dụng Dịch Vụ - Minh Duy Solutions
No Result
View All Result
Home Hướng dẫn Website Hướng dẫn WordPress

Một số thủ thuật cho Theme Flatsome

Minh Duy Solutions by Minh Duy Solutions
17/06/2023
Reading Time: 4 mins read
290 3
A A
0
thiet lap trang chu Theme Flatsome
909
SHARES
2.9k
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Cách ẩn thông báo đăng ký flatsome
  2. Cài đặt theme Flatsome
  3. Fix lỗi width ( chiều ngang ) trên smartphone
  4. Ngăn các Block trong UX Builder tạo html khi chọn hidden
  5. Di chuyển sản phẩm hết hàng xuống cuối danh sách hiển thị

Tổng hợp các tricks/tips cho người dùng sử dụng theme WordPress vô cùng nổi tiếng Flatsome. Nguồn có thể được lưu lại hoặc không, hầu hết đều là mình copy về tổng hợp. Mọi vấn đề liên quan đến bản quyền vui lòng liên hệ cá nhân.

UPDATE từ Flatsome version 3.14.0

Cách ẩn thông báo đăng ký flatsome

Sau khi update lên 3.14.x, mình dám chắc ai cũng gặp cái “cục” khó chịu này và đây sẽ là giải pháp “tạm thời”. Mình không khuyến khích dùng theme “null” hehe

Thêm đoạn này vào function.php của theme

add_action( 'init', 'hide_notice' );
function hide_notice() {
   remove_action( 'admin_notices', 'flatsome_maintenance_admin_notice' );
}

Cài đặt theme Flatsome

Hiện tại bản flatsome 3.14.1 tải về lúc setup childtheme sẽ cần nhập key vô mới tiếp tục được, không cho skip như trước. Giờ muốn setup thì ở step nhập key thì mới next được. Giải pháp tạm thời là sửa paramete url cuối domain là:

<domain.com>/wp-admin/admin.php?page=flatsome-setup&step=updates

Sửa đoạn cuối thành: flatsome-setup&step=customize

Fix lỗi width ( chiều ngang ) trên smartphone

Việc sử dụng flatsome trên di động luôn bị di chuyển nhẹ nhẹ theo chiều ngang, cách giải quyết, bạn hãy chèn vào Custom CSS dành cho Mobile chỉ với 1 dòng code nhỏ như sau:

body {overflow-x:hidden;}

Ngăn các Block trong UX Builder tạo html khi chọn hidden

Tính năng: Ngăn các Block trong UX tạo html khi chọn hidden, mặc định Flatsome chỉ dùng css display none để ẩn những html đó.

Lợi ích: Làm được 2 template riêng cho mobile và desktop, kèm theo cũng rất nhiều lợi ích khi không phải doshorte code không dùng đến.

// Ngăn UXBuilder tự tạo html kể cả khi chọn visible hidden
add_filter( 'do_shortcode_tag', 'add_filter_shortcode_ux_visibility', 10, 3 );
function add_filter_shortcode_ux_visibility( $output, $tag, $attr ) {
    if( !isset($attr['visibility']) )
        return $output;
    if($attr['visibility'] == 'hidden')
        return;
    if( ($attr['visibility'] == 'hide-for-medium') &&  wp_is_mobile() ) 
        return;
    elseif( ($attr['visibility'] == 'show-for-small') && !wp_is_mobile() ) 
        return;
    elseif( ($attr['visibility'] == 'show-for-medium') && !wp_is_mobile() )
        return;
    elseif( ($attr['visibility'] == 'hide-for-small') && wp_is_mobile() )
        return;
    return $output;
}

Lưu ý: Bật cache mobile riêng

Di chuyển sản phẩm hết hàng xuống cuối danh sách hiển thị

* Order by stock status
 * Shared by levantoan.com
 * */
add_filter('posts_clauses', 'devvn_order_by_stock_status', 2000);
function devvn_order_by_stock_status($posts_clauses) {
    global $wpdb;
    if (is_woocommerce() && (is_shop() || is_product_category() || is_product_tag())) {
        $posts_clauses['join'] .= " INNER JOIN $wpdb->postmeta istockstatus ON ($wpdb->posts.ID = istockstatus.post_id) ";
        $posts_clauses['orderby'] = " istockstatus.meta_value ASC, " . $posts_clauses['orderby'];
        $posts_clauses['where'] = " AND istockstatus.meta_key = '_stock_status' AND istockstatus.meta_value <> '' " . $posts_clauses['where'];
    }
    return $posts_clauses;
}

Code sưu tầm trên Stackoverflow

/*** Sorting out of stock WooCommerce products - Order product collections by stock status, in-stock products first.
*/
class iWC_Orderby_Stock_Status
{
public function __construct()
{
// Check if WooCommerce is active
if (in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')))) {
add_filter('posts_clauses', array($this, 'order_by_stock_status'), 2000);
}
}
public function order_by_stock_status($posts_clauses)
{
global $wpdb;
// only change query on WooCommerce loops
if (is_woocommerce() && (is_shop() || is_product_category() || is_product_tag())) {
$posts_clauses['join'] .= " INNER JOIN $wpdb->postmeta istockstatus ON ($wpdb->posts.ID = istockstatus.post_id) ";
$posts_clauses['orderby'] = " istockstatus.meta_value ASC, " . $posts_clauses['orderby'];
$posts_clauses['where'] = " AND istockstatus.meta_key = '_stock_status' AND istockstatus.meta_value <> '' " . $posts_clauses['where'];
}
return $posts_clauses;
}
}
new iWC_Orderby_Stock_Status;
/**
* END - Order product collections by stock status, instock products first.
*/

Đại loại là di chuột vào menu thì các vùng xung quanh tối đi 1. Thêm code vào function.php của theme/child theme đang kích hoạt

add_action('wp_footer', 'qwans_add_darkness_dropdown');
function qwans_add_darkness_dropdown (){
    echo '<div class="darkness"></div>';
};

Thêm CSS

.darkness {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0;
    visibility: hidden;
    background-color: rgba(0,0,0,.7);
    -webkit-transition: opacity 0.25s ease,visibility 0s ease 0.25s;
    transition: opacity 0.25s ease,visibility 0s ease 0.25s;
}
.darkness-opened {
    opacity: 1;
    visibility: visible;
    -webkit-transition: opacity 0.25s ease,visibility 0.25s ease;
    transition: opacity 0.25s ease,visibility 0.25s ease;
}

Script vào Footer Scripts

<script>jQuery(document).ready(function($) {
$( '.menu-item-has-children' ).on('mouseover', function(e) {
                    if ( $(window).width() < 1024 ) return;
                    e.preventDefault();
                    if (!$('.menu-item').hasClass( '.has-dropdown' ) ) {
                         $('.darkness').addClass('darkness-opened');
                    }
                });
                $( '.menu-item.has-dropdown' ).on('mouseleave', function(e) {
                    if ( $(window).width() < 1024 ) return;
                    e.preventDefault();
                    if (!$('.menu-item').hasClass( '.has-dropdown' ) ) {
                         $('.darkness').removeClass('darkness-opened');
                    }
                });
});
</script>

Nguồn: https://gist.github.com/Qwans/92d813b94076f867e2d52c3121a2a5b3

 

Một số website thủ thuật, mẫu sử dụng theme Flatsome rất tuyệt vời để tham khảo và có thể áp dụng
Đây là bản lưu nhanh, dưới đây là một số website có những tips/tricks hay dành cho người sử dụng theme Flatsome.

https://www.sebdelaweb.com/https://codeinform.com/category/flatsome/https://www.flatelements.com/flatsome-tutorials/

4.3/5 - (100 bình chọn)
Tags: flatsome
Share364Tweet227
Minh Duy Solutions

Minh Duy Solutions

Bài viết liên quan

stop wordpress user registration spam
Hướng dẫn WordPress

Hướng dẫn xoá hàng loạt user spam trên WordPress

23/05/2025
1.5k
thanh top woo c
Hướng dẫn Website

Hướng dẫn ẩn thanh Edit Product che mất tùy chọn khi đăng sản phẩm của WooComerce

24/09/2024
1.6k
flatsome theme 1
Hướng dẫn Website

Hướng dẫn tắt UXBuilder ở 1 số post type theme Flatsome

24/09/2024
1.6k
flatsome theme 1
Hướng dẫn Website

Bật UX Builder cho Custom post type trên theme Flatsome

24/09/2024
1.8k
Contact Form 7
Hướng dẫn Website

Chống spam cho plugin Contact Form 7

19/06/2024
1.6k
Contact Form 7
Hướng dẫn WordPress

Hướng dẫn cách truyền tiêu đề bài viết, sản phẩm vào Contact Form 7

19/06/2024
1.6k

Để lại một bình luận Hủy

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

No Result
View All Result

Recommended.

Làm gì khi server thực hiện spam mail trên Directadmin

22/09/2021
1.6k
phpmyadmin xu ly loi incorrect format parameter khi nhap du lieu

phpMyAdmin: Xử lý lỗi Incorrect format parameter khi nhập dữ liệu

16/08/2022
1.9k

Trending.

find large files in

Hướng dẫn tìm file và thư mục có dung lượng lớn nhất trên VPS Linux

25/10/2021
1.6k
cach tai toan bo email tren gmail ve may tinh de luu tru 4763

Cách tải toàn bộ email trên Gmail về máy tính để lưu trữ

10/04/2026
1.5k
Tên miền website là gì?

Vòng đời tên miền Việt Nam và Quốc Tế cập nhật năm 2026

07/04/2026
1.5k
binhluan

Cách ẩn comment trên Fanpage để tránh bị cướp khách hàng

09/12/2025
1.5k
5358fe1a7da72ce25dc1c40fb518359a

Hướng dẫn xóa hàng loạt bản ghi DNS khỏi Cloudflare

16/07/2025
1.5k
Wiki Minh Duy Solutions

WIKI.MINHDUY.VN

Chuyên trang hướng dẫn sử dụng dịch vụ của Minh Duy Solutions

DMCA.com Protection Status

Danh mục

  • GSuite
  • aaPanel
  • Góc ICT
  • Thiết Kế Đồ Hoạ
  • SEO
  • Hướng dẫn WHMCS
  • Hướng dẫn WordPress
  • Email Zimbra
  • Hướng dẫn DirectAdmin
  • Hướng dẫn Hosting cPanel
  • Hướng dẫn Hosting
  • Office 365
  • Hướng dẫn Website
  • Hướng dẫn Linux
  • Hướng dẫn Hosting DirectAdmin
  • Google Work Space
  • Hướng dẫn Webmaster
  • Hướng dẫn máy chủ
  • Hướng dẫn Email Doanh Nghiệp
  • Hướng dẫn Tên miền
  • Hướng dẫn chung
  • Uncategorized

Thẻ

AFC apt-get update apt-get upgrade category chủ thể cPanel debian DirectAdmin email doanh nghiệp Environment Variables giải nén Google Workspace G Suite hosting ioncube khôi phục mật khẩu linux nginx nmap nodejs npm Office 365 OneDrive Outlook out of memory path Paypal phpmyadmin SMTP. GMail SSH sudo swap Symbolic Link tar tar.gz thông báo tên miền tên miền ubuntu user whois WooCommerce WordPress wordpress cơ bản wp rocket Zimbra
  • Về minhduy.vn
  • Đăng ký Hosting
  • Thiết kế Website
  • Khuyến mãi HOT

Copyright © Hướng dẫn Minh Duy Solutions

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
×
    No Result
    View All Result
    • Trang chủ
    • Hosting
      • Hướng dẫn Hosting cPanel
      • Hướng dẫn Hosting DirectAdmin
    • Tên miền
    • Website
      • Hướng dẫn WordPress
      • Hướng dẫn Webmaster
    • Email Doanh Nghiệp
      • Office 365
      • Google Work Space
      • Email Zimbra
    • VPS – Máy chủ
      • Hướng dẫn Linux
      • Hướng dẫn DirectAdmin
    • Hướng dẫn chung
    • Góc ICT

    Copyright © Hướng dẫn Minh Duy Solutions