/*
Theme Name:           Flatsome
Theme URI:            http://flatsome.uxthemes.com
Author:               UX-Themes
Author URI:           https://uxthemes.com
Description:          Multi-Purpose Responsive WooCommerce Theme
Version:              3.20.2
Requires at least:    6.4
Requires PHP:         7.4
WC requires at least: 8.3
Text Domain:          flatsome
License:              https://themeforest.net/licenses
License URI:          https://themeforest.net/licenses
*/


/***************
All custom CSS should be added to Flatsome > Advanced > Custom CSS,
or in the style.css of a Child Theme.
***************/
<!-- PHẦN CSS ĐỊNH DẠNG BANNER -->
<style>
.qc-doc-trai, .qc-doc-phai {
    position: fixed; /* Luôn cố định khi cuộn trang */
    z-index: 9999; /* Hiển thị trên cùng */
    top: 150px; /* Khoảng cách từ trên xuống */
    width: 130px; /* Chiều rộng của banner */
}
.qc-doc-trai {
    left: 20px; /* Khoảng cách từ lề trái */
}
.qc-doc-phai {
    right: 20px; /* Khoảng cách từ lề phải */
}
/* Tự động ẩn banner trên màn hình nhỏ hơn 1024px */
@media (max-width: 1024px) {
    .qc-doc-trai, .qc-doc-phai {
        display: none;
    }
}
</style>

// Hiển thị ngày đăng ở cuối nội dung bài viết hoặc trang trong Flatsome
add_filter('the_content', 'clv_add_post_date_flatsome');
function clv_add_post_date_flatsome($content) {
    if ((is_single() || is_page()) && in_the_loop() && is_main_query()) {
        $date = get_the_date('d/m/Y');
        $add_date = '<div style="text-align:center; margin-top:25px; font-size:16px; color:#007b00;">
        🗓 Ngày đăng: ' . $date . '
        </div>';
        return $content . $add_date;
    }
    return $content;
}



