This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.element { | |
backdrop-filter: saturate(50%) blur(8px); | |
-webkit-backdrop-filter: saturate(50%) blur(8px); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Wordpress Custom Search by title, ACF, post_meta */ | |
// Wordpress ?s= redirect to /search/ | |
function wpa_search_redirect() { | |
global $wp_rewrite; | |
if (!isset($wp_rewrite) || !is_object($wp_rewrite) || !$wp_rewrite->using_permalinks()) { return; } | |
$search_base = $wp_rewrite->search_base; | |
if (is_search() && !is_admin() && strpos($_SERVER['REQUEST_URI'], "/{$search_base}/") === false) { | |
wp_redirect(home_url("/{$search_base}/" . urlencode(get_query_var('s')))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* ajax Defaults (optional): | |
$.ajaxSetup({ | |
type : 'POST', | |
dataType : 'json', | |
cache : true, | |
global : true, | |
data : {}, | |
contentType : 'application/json', | |
beforeSend : function (xhr) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//place code in the end of functions.php in theme | |
add_action('template_redirect', 'wc_sku_redirect'); | |
function wc_sku_redirect() { | |
$parseUrl = explode('/', $wp->request); | |
if(isset($parseUrl[0]) && $parseUrl[0] === 'product') { | |
$pid = wc_get_product_id_by_sku($parseUrl[1]); | |
if($pid) { | |
wp_safe_redirect(get_permalink($pid)); | |
exit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"id": "new24", | |
"category_id": "new-category", | |
"category_name": "Моя нова категорія", | |
"category_published": true, | |
"name": "Новий товар lab24", | |
"private": false, | |
"price": 199, | |
"pricelist": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function load_defer_img(source) { | |
'use strict'; | |
return $.Deferred(function(task) { | |
var image = new Image(); | |
image.onload = function() { | |
task.resolve(image); | |
}; | |
image.onerror = function() { | |
task.reject(); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The MIT License (MIT) | |
Copyright (c) 2015 Textalk | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get_cpt_archives( $cpt, $echo = false ) { | |
global $wpdb; | |
$sql = $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE post_type = %s AND post_status = 'publish' GROUP BY YEAR({$wpdb->prefix}posts.post_date), MONTH({$wpdb->prefix}posts.post_date) ORDER BY {$wpdb->prefix}posts.post_date DESC", $cpt ); | |
$results = $wpdb->get_results( $sql ); | |
if ( $results ) { | |
$archive = array(); | |
foreach ( $results as $r ) { | |
$year = date( 'Y', strtotime( $r->post_date ) ); | |
$month = date( 'F', strtotime( $r->post_date ) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$tel = get_field( 'tel', 'options' ); | |
echo $tel ? '<a class="header-tel" href="tel:' . preg_replace( "/[^0-9+]/", "", $tel ) . '">' . $tel . '</a>' : ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "load-google-maps", | |
"version": "1.0.0", | |
"authors": ["Glenn Baker", "Gavin Foley", "Matteo Gaggiano"], | |
"description": "Load Google Maps API using jQuery Deferred.", | |
"main": "load-google-maps.js", | |
"keywords": ["Google Maps", "Async"], | |
"license": ["MIT", "GPL"], | |
"dependencies": { | |
"jquery": ">=1.5" |