Skip to content

Instantly share code, notes, and snippets.

View saas786's full-sized avatar
🏠
Working from home

saasfreelancer saas786

🏠
Working from home
View GitHub Profile
@AlphaBlossom
AlphaBlossom / alphablossom-equal-height-fixed-width.css
Created June 27, 2014 01:00
Equal, Full Height Colums using CSS Only
.content-sidebar-wrap {
position: relative;
float: left;
width: 100%;
margin-bottom: 50px;
z-index: 99; /* needed for Safari 7 */
}
.content:after,
.sidebar-primary:after {
@scofennell
scofennell / DraggableSortableCheckboxesfortheWordPressCustomizer.php
Last active August 29, 2015 14:22
DraggableSortableCheckboxesfortheWordPressCustomizer.php
class LXB_AF_Checkbox extends WP_Customize_Control {
// I'm not sure where this gets used but it's in the codex.
public $type = 'checkbox_group';
/**
* This method must be named, exactly, 'render_content', as that's
* expected by the WP core cusotmization class, which it extends. It
* outputs the HTML for our custom input.
*
@naholyr
naholyr / update-sublime-text.sh
Created September 6, 2011 15:27
Install or update Sublime Text from web site
#!/bin/bash
# Requirements: sed, grep, curl, pkill
# User configuration
LOCAL_INSTALL="/usr/lib/sublime-text-2" # Must be user-writable
REPO="dev" # "dev" for dev releases, or "2" for beta releases
TARGET_BUILD="Linux 32 bit" # can be one of "Windows", "Windows 64 bit", "OS X", "Linux 32 bit", "Linux 64 bit"
# Check if sublime text is running
@ryelle
ryelle / mp6-color-schemes.php
Last active December 22, 2015 20:59
This is an example plugin that creates 2 color schemes for use with MP6, using the new `mp6_add_admin_colors` function.
<?php
/**
* Plugin Name: MP6 Color Scheme
*/
function kd_mp6_add_colors() {
// Check that MP6 exists and that our new function exists
if ( ! defined( 'MP6' ) || ! function_exists( 'mp6_add_admin_colors' ) )
return;
mp6_add_admin_colors( 'sunset', array(
@ericandrewlewis
ericandrewlewis / gist:8290246
Last active January 2, 2016 10:29
WordPress Post Meta ideas
<?php
/**
* Post Meta Box view/controller class.
*
* Extends from a form object base class.
*
* Creates a meta box. Fields can be related to the meta box, but
* all business logic lives within the field object.
*/
@redesigned
redesigned / functions.php
Last active March 24, 2016 12:27
Wordpress Magento Cross Integration
/* ===================================== */
/* Add This to Wordpress's /wp-content/yourtheme/functions.php file */
define('MAGENTO_ROOT', '/Volumes/Storage/www/heartandsun/store/');
define('MAGENTO_LOADER', MAGENTO_ROOT.'app/Mage.php');
if (!class_exists('Mage')) {
require_once(MAGENTO_LOADER);
umask(0);
Mage::app("default");
};
/* ===================================== */
@brianfeister
brianfeister / attach_heads.js
Created December 15, 2012 13:04
Sub-theming engine for Grunt.js + Roots Theme + Twitter Bootstrap
/**
* Task: attach_heads
* Description: Set the heads for all themes declared in themes.json
*/
module.exports = function(grunt) {
'use strict';
var fs = require('fs');
var path = require('path');
@bueltge
bueltge / example.php
Last active June 15, 2017 05:39
Example to use the taxonomie Dropdown for Customizer, the classes are inside the project: https://github.com/bueltge/Wordpress-Theme-Customizer-Custom-Controls
<?php
/**
* @see: https://github.com/bueltge/Wordpress-Theme-Customizer-Custom-Controls
*/
add_action( 'customize_register', 'fb_customize_register' );
function fb_customize_register( $wp_customize ) {
require_once( 'class-taxonomy_dropdown_custom_control.php' );
$wp_customize->add_section(
@mikejolley
mikejolley / gist:3709371
Created September 12, 2012 19:41
Remove WooCommerce Generator Tag
function my_woocommerce_loaded_function() {
global $woocommerce;
// remove WC generator tag from <head>
remove_action( 'wp_head', array( $woocommerce, 'generator' ) );
}
// called only after woocommerce has finished loading
add_action( 'woocommerce_init', 'my_woocommerce_loaded_function' );
@justintadlock
justintadlock / customize-control-radio-image.php
Last active September 5, 2018 17:14
Customize Control: Radio Image
<?php
/**
* The radio image customize control extends the WP_Customize_Control class. This class allows
* developers to create a list of image radio inputs.
*
* Note, the `$choices` array is slightly different than normal and should be in the form of
* `array(
* $value => array( 'url' => $image_url, 'label' => $text_label ),
* $value => array( 'url' => $image_url, 'label' => $text_label ),
* )`