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
import sublime, sublime_plugin, re | |
DEBUG_ENABLED = False | |
PRINT_CONTEXT = False | |
# Toggle between single-line or multi-line formatted css statement | |
# | |
# Save as: ~/Library/Application Support/Sublime Text 2/Packages/User/CSSToggle.py | |
# | |
# Add the following line to Preferences > Key Bindings - User |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>name</key> | |
<string>Simple</string> | |
<key>settings</key> | |
<array> | |
<dict> | |
<key>settings</key> |
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
/* | |
Theme Name: Twenty Twelve Child | |
Theme URI: http://example.com/ | |
Description: Child theme for the Twenty Twelve theme | |
Author: Your name here | |
Author URI: http://example.com/about/ | |
Template: twentytwelve | |
Version: 0.1.0 | |
*/ |
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 function mobile_device($classes) { | |
global $variable; | |
$is_ipad = (bool) strpos($_SERVER['HTTP_USER_AGENT'],'iPad'); | |
$is_iphone = (bool) strpos($_SERVER['HTTP_USER_AGENT'],'iPhone'); | |
$is_ipod = (bool) strpos($_SERVER['HTTP_USER_AGENT'],'iPod'); | |
$is_android = (bool) strpos($_SERVER['HTTP_USER_AGENT'],'Android'); | |
if ( $is_android ) { | |
$mobile_device = 'android'; | |
} elseif ( $is_iphone || $is_ipad || $is_ipod ) { |
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(){ // document ready | |
if (!!$('.sticky').offset()) { // make sure ".sticky" element exists | |
var stickyTop = $('.sticky').offset().top; // returns number | |
$(window).scroll(function(){ // scroll event | |
var windowTop = $(window).scrollTop(); // returns number | |
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 | |
// http://codex.wordpress.org/Class_Reference/WP_Query | |
$query = new WP_Query( 'p=7' ); | |
$query = new WP_Query( 'name=about-my-life' ); | |
$query = new WP_Query( 'page_id=7' ); | |
$query = new WP_Query( 'pagename=contact' ); |
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 | |
// Action Hook | |
add_action('action_name', 'your_function_name'); | |
function your_function_name() { | |
// Your code | |
} | |
// Filter Hook |
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 | |
// http://wp.smashingmagazine.com/2012/11/08/complete-guide-custom-post-types/ | |
// http://codex.wordpress.org/Function_Reference/register_post_type | |
function custom_post_type_employees() { | |
$labels = array( | |
'name' => _x( 'Employees', 'post type general name' ), | |
'singular_name' => _x( 'Employee', 'post type singular name' ), | |
'menu_name' => _x( 'Employees', 'wordpress menu name, default value of name' ), | |
'add_new' => _x( 'Add New', 'employee' ), | |
'add_new_item' => __( 'Add New Employee' ), |
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 | |
add_action('init', 'woo_add_portfolio'); | |
if ( !function_exists('woo_add_portfolio') ) { | |
function woo_add_portfolio() | |
{ | |
$labels = array( | |
'name' => _x('Portfolio', 'post type general name', 'woothemes'), | |
'singular_name' => _x('Portfolio Item', 'post type singular name', 'woothemes'), | |
'add_new' => _x('Add New', 'slide', 'woothemes'), | |
'add_new_item' => __('Add New Portfolio Item', 'woothemes'), |
OlderNewer