VIEW POST

View more


VIEW POST

View more
Thủ Thuật

Filter Post by Price & Variations

on
June 2, 2023

Function Code

add_action(‘pre_get_posts’, function ($query) {
if(is_tax(‘product_cat’)) {
// Price Filter
$p1 = $_POST;
$p2 = $_POST;
$p3 =…


VIEW POST

View more
Thủ Thuật

Convert GMT to other TimeZone in Javascript

on
March 20, 2023

const options = { timeZone: ‘Asia/Tokyo’ };
const date = new Date(); //Khai báo Date sẽ được Convert
const japanTime = date.toLocaleString(
    ‘ja-JP’,
    options
);


VIEW POST

View more
Thủ Thuật

Tips&Tricks

on
January 31, 2023

Tips & Tricks

1. Hack IE với CSS

– Hack IE9 Only
:root .class/#id { property:value \0/IE9; }

– Hack IE10 & 11
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
/* Code Here */
}


VIEW POST

View more
Thủ Thuật

Infinite Scroll Slider

on
January 31, 2023

Infinite Scroll SliderVersion 2.0

Slider chạy tự động liên tục từ phải qua trái. Hỗ trợ responsive.

History

v2.0
Chuyển handle start/stop ra ngoài.Cho phép itemWidth có thể get theo function thay vì số cố địnhChuyển việc pause khi hover thành option

v1.0
Tạo mới function

Use

var banner = new $.GDITFUNC.autoCarouselSlider();

$(window).resize(function(){
banner.updateSlider();
});

Options

Name
Type
Default
Description

selector
jQuery selector
$(‘#tmp_intro_banner’)
Thẻ…


VIEW POST

View more
Thủ Thuật

Search and filter

on
January 31, 2023

Search and filter

Dùng để tạo tính năng tìm kiếm và lọc 1 danh sách thích hợp từ 1 mảng JSON

Luồng đi chính

Logic luồng đi chính

 

Để hàm searchAndFilter hoạt động hiệu quả cần cung cấp cho nó 2 yếu tố quan trọng

Data ban đầu dạng array với các…


VIEW POST

View more
Thủ Thuật

Custom Event: Sắp xếp các function, animation chạy theo thứ tự chỉ định

on
January 5, 2023

Code

$.GFUNC.customEvent = function(){
var listeners = [];
function add_event(event_name,event_handler){
if (listeners){
listeners.push(event_handler);
}else{


VIEW POST

View more
Thủ Thuật

Get a List of Products on Sale in WooCommerce

on
July 12, 2022

Check if product is on sale

We can simply check if a product is on sale on by using is_on_sale() function.

<?php

global $product;
if ( $product->is_on_sale() ) {
// wow product is on sale
// do something
}

Get Products on Sale from All Categories

On contrary, getting a list of…


VIEW POST

View more
Thủ Thuật

Get all Categories/Taxonomies of CPT

on
December 25, 2021

<?php
$args = array(
‘taxonomy’ => ‘product_category’,
‘orderby’ => ‘ID’,
‘order’ => ‘DESC’
);

$cats = get_categories($args);

foreach($cats as $cat) {
?>


VIEW POST

View more
Thủ Thuật

Import WordPress với DeMomentSomTres Export

on
April 25, 2021

WordPress có 1 lỗi mà mãi không biết tại sao đó là khi Import bài viết bằng Tool WordPress Importer thì không Import được Media.

Cách đây 6 năm mình đã gặp lỗi này từ khi còn làm ở Wpprocare. May mà có tìm được Plugin “DeMomentSomTres Export” cho phép…

Mai Phước Nghĩa
Danang, Vietnam

Xin chào!!! Mình là Phước Nghĩa. Trang Web này là 1 phút ngẫu hứng trong lúc rảnh rỗi nên cũng chưa biết viết gì :D Chắc sẽ lại những bài viết linh tinh hoặc kỉ niệm du lịch đây đó. Mong mọi người ủng hộ :D :D