Skip to content

Instantly share code, notes, and snippets.

View wc_filter_tes.js
(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 Aug 10, 2018
Get semantic ui icons. Go to https://semantic-ui.com/elements/icon.html paste this code to console.
View get-semantic-ui-icons.js
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 Jul 30, 2018
Get distance from lat and long
View search-proximity.php
<?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;
View Download.php
<?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" );
View customify-upsell
<?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
Install and active by url or ajax
View intall-active-theme.php
<?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,
View customify-api-v2.php
<?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 Apr 23, 2018
Customify Export Default Theme Mod
View customify- export-default
<?php
/**
* Plugin Name: Customify Export Default
* Plugin URI: #
* Description:
* Author:
* Version: 1.0
*/
View customize-config-examples.php
<?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 Feb 26, 2018 — forked from OriginalEXE/pe-customize-controls.css
Extending WordPress Customizer Panels and Sections to allow nesting
View pe-customize-controls.css
.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%);
}