VIEW POST
VIEW POST
Function Code
add_action(‘pre_get_posts’, function ($query) {
if(is_tax(‘product_cat’)) {
// Price Filter
$p1 = $_POST;
$p2 = $_POST;
$p3 =…
VIEW POST
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
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
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
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
Code
$.GFUNC.customEvent = function(){
var listeners = [];
function add_event(event_name,event_handler){
if (listeners){
listeners.push(event_handler);
}else{
…
VIEW POST
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
<?php
$args = array(
‘taxonomy’ => ‘product_category’,
‘orderby’ => ‘ID’,
‘order’ => ‘DESC’
);
$cats = get_categories($args);
foreach($cats as $cat) {
?>
VIEW POST
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…