Skip to content

Instantly share code, notes, and snippets.

(function ($, window, document) {
"use strict";
var customifyWCFiterXHR = false;
$.fn.customifyOffCanvas = function ( options ) {
var opts = $.extend({
selector : '.woocommerce-listing',
}, options );
@shrimp2t
shrimp2t / get-semantic-ui-icons.js
Created August 10, 2018 09:46
Get semantic ui icons. Go to https://semantic-ui.com/elements/icon.html paste this code to console.
var icons = [];
$('.icon.example').each( function( ) {
var group = $( this );
$( '.column > i', group ).each( function(){
var icon = $(this).attr('class') || '';
icons.push( icon );
} );
} );
@shrimp2t
shrimp2t / search-proximity.php
Last active July 30, 2018 00:55
Get distance from lat and long
<?php
/**
* Get the SQL query for getting listings within a given proximity.
*
* @link https://wordpress.stackexchange.com/a/206560/123815
* @since 1.0.0
*/
public function get_proximity_sql() {
global $wpdb;
<?php
// Set the file size header
header( "Content-Length: " . @filesize( $file_path ) );
// Now deliver the file based on the kind of software the server is running / has enabled
if ( stristr( getenv( 'SERVER_SOFTWARE' ), 'lighttpd' ) ) {
header( "X-LIGHTTPD-send-file: $file_path" );
<?php
if (is_admin() || is_customize_preview()) {
if( class_exists( 'WP_Customize_Section' ) ) {
class Customify_Section_Pro extends WP_Customize_Section
{
/**
* The type of customize section being rendered.
*
* @since 1.0.0
@shrimp2t
shrimp2t / intall-active-theme.php
Created May 10, 2018 03:54
Install and active by url or ajax
<?php
// get_current_screen()
//$class= 'updated notice notice-success notice-alt is-dismissible';
// install theme url esc_url( wp_nonce_url( $install_url, 'install-theme_' . $theme->slug ) )
$theme_slug = 'twentyseventeen';
$install_url = add_query_arg( array(
'action' => 'install-theme',
'theme' => $theme_slug,
<?php
/*
Plugin Name: Customify Sites REST API
Plugin URI: http://customifysites.com/
Description: Add REST API end point for customify demo importer
Author: shrimp2t
Author URI: http://customifysites.com/
Version: 0.0.1
Text Domain: customify-sites-api
License: GPL version 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
@shrimp2t
shrimp2t / customify- export-default
Created April 23, 2018 08:49
Customify Export Default Theme Mod
<?php
/**
* Plugin Name: Customify Export Default
* Plugin URI: #
* Description:
* Author:
* Version: 1.0
*/
@shrimp2t
shrimp2t / customize-config-examples.php
Created March 14, 2018 04:14
Customify config examples
<?php
if (!function_exists('customify_customizer_config')) {
function customify_customizer_config($configs)
{
$config = array(
array(
'name' => 'customify_panel',
'type' => 'panel',
'theme_supports' => '',
@shrimp2t
shrimp2t / pe-customize-controls.css
Created February 26, 2018 09:26 — forked from OriginalEXE/pe-customize-controls.css
Extending WordPress Customizer Panels and Sections to allow nesting
.in-sub-panel #customize-theme-controls .customize-pane-child.current-panel-parent,
#customize-theme-controls .customize-pane-child.current-section-parent {
-webkit-transform: translateX(-100%);
-ms-transform: translateX(-100%);
transform: translateX(-100%);
}