Skip to content

Instantly share code, notes, and snippets.

@Longkt
Longkt / OnePress theme.js
Created January 8, 2019 03:36
support IE 11 for version 2.2.1 - header, menu burger
var isMobile = {
Android: function() {
return navigator.userAgent.match(/Android/i);
},
BlackBerry: function() {
return navigator.userAgent.match(/BlackBerry/i);
},
iOS: function() {
return navigator.userAgent.match(/iPhone|iPad|iPod/i);
},
@Longkt
Longkt / theme.min.js
Created January 13, 2019 11:17
Customify theme.min.js
"use strict";Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;if(!document.documentElement.contains(t))return null;do{if(t.matches(e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null}),function(){var e=function(){this.options={menuToggleDuration:300},this.menuSidebarState="closed",this.isPreviewing=document.body.classList.contains("customize-previewing"),this.init()};e.prototype.checkTouchScreen=function(){"ontouchstart"in document.documentElement?document.body.classList.add("ontouch-screen"):document.body.classList.add("not-touch-screen")},e.prototype.isMobile=function(){return!!(navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.us
add_action( 'init', 'add_my_custom_header' );
function add_my_custom_header() {
remove_action( 'onepress_site_start', 'onepress_site_header' );
add_action( 'onepress_site_start', 'custom_onepress_site_header' );
}
function custom_onepress_site_header() {
$header_width = get_theme_mod( 'onepress_header_width', 'contained' );
$is_disable_sticky = sanitize_text_field( get_theme_mod( 'onepress_sticky_header_disable' ) );
$classes = array(
@Longkt
Longkt / OnePress theme.js (change isMobile function to onepressIsMobile)
Last active May 4, 2019 04:03
OnePress theme.js (change isMobile function to onepressIsMobile)
var onepressIsMobile = {
Android: function() {
return navigator.userAgent.match(/Android/i);
},
BlackBerry: function() {
return navigator.userAgent.match(/BlackBerry/i);
},
iOS: function() {
return navigator.userAgent.match(/iPhone|iPad|iPod/i);
},
<?php
$google_fonts = '
{
"kind": "webfonts#webfontList",
"items": [
{
"kind": "webfonts#webfont",
"family": "ABeeZee",
/**
* Shipping City for WooCommerce
*
* @author longnguyen [email protected]
* https://profiles.wordpress.org/longnguyen
*/
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
add_action( 'woocommerce_shipping_init', 'woocommerce_shipping_city_init' );
add_filter( 'woocommerce_shipping_methods', 'woocommerce_shipping_city_method' );
<?php
/**
* News Recent Posts
*/
class my_passionate_recent_posts extends WP_Widget {
public function __construct() {
parent::__construct(
'passionate_recent_posts',
/**
* Set Cookie
*
* @param cname
* @param cvalue
* @param exdays
*/
function setCookie( cname, cvalue, exdays ) {
var d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000));
== Changelog ==
## 1.3.0
* FIXED: js error in page theme options.
## 1.2.9
* NEW: add option to show/hide the post meta on single post.
* NEW: add option to enable/disable group of expired coupons.
## 1.2.8
* NEW: add option to hide the "submit a coupon" on store page.
* NEW: support RTL for coupon slider & carousel.
* IMPROVED: Update a small typo issue.
<html lang=&quot;en&quot;> <head> <title>gateway</title> <meta http-equiv=&quot;Expires&quot; content=&quot;28FEB2002&quot; /> <meta http-equiv=&quot;CACHE-CONTROL&quot; content=&quot;NO-CACHE&quot; /> <script type=&quot;text/javascript&quot;> function addFields(formObj){}function redirect(commitType){var cookieenabled=false;if(navigator.cookieEnabled){if(navigator.cookieEnabled==true){var exdate=new Date();exdate.setDate(exdate.getDate()+1);document.cookie=&quot;DGCC=&quot;+escape(genPid())+&quot;;path=/;expires=&quot;+exdate.toGMTString();cookieenabled=(document.cookie.indexOf(&quot;DGCC&quot;)!=-1)? true : false;}}if(cookieenabled){if(commitType==&quot;reload&quot;)window.location.reload(true);else{var oFrm=document.createElement(&quot;form&quot;);var oEnvlp=document.getElementById(&quot;frmPlsHldr&quot;);oFrm.method=&quot;post&quot;;addFields(oFrm);oEnvlp.appendChild(oFrm);oFrm.submit();}}else{var oJSCookieMSGObj=document.getElementById('JSCookieMSG');oJSCookieMSGObj.style.display='block';}}</script> </he