Skip to content

Instantly share code, notes, and snippets.

@jerrylee
jerrylee / Codekit Prepend for Bootstrap
Created November 12, 2014 13:31
Codekit Prepend for Bootstrap
//@codekit-prepend "jquery.js"
//@codekit-prepend "affix.js"
//@codekit-prepend "alert.js"
//@codekit-prepend "button.js"
//@codekit-prepend "carousel.js"
//@codekit-prepend "collapse.js"
//@codekit-prepend "dropdown.js"
//@codekit-prepend "tab.js"
//@codekit-prepend "transition.js"
//@codekit-prepend "scrollspy.js"
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Redirect Generator</title>
<script type="text/javascript" src="http://code.angularjs.org/1.2.25/angular.min.js"></script>
</head>
<body ng-app="redirectGenerator">
<div ng-init="redirects = [
{original:'/boise/semi-truck-accidents/', new:'http://www.craigswapp.com/boise/truck-accident-lawyer/'},
<?php
function enqueue_scripts() {
wp_enqueue_script('bootsrap_script',get_template_directory_uri() . '/js/bootstrap.js',array(jquery),'1.0',true);
wp_enqueue_script('custom_script',get_template_directory_uri() . '/js/scripts.js',array(jquery),'1.0',true);
}
add_action('wp_enqueue_scripts','enqueue_scripts');
@jerrylee
jerrylee / WP Query Snippets args
Created December 11, 2014 20:22
Collection of various arguments for WP Query
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@jerrylee
jerrylee / CPT Menu
Created January 5, 2015 14:45
CPT Menu
<?php
if (is_page('92') || '92' == $post->post_parent) { $locationMenu = 'boise'; }
elseif($post->ID == '103') || '103' == $post->post_parent) { $locationMenu = 'Spokane'; }
elseif(is_page('5') || '5' == $post->post_parent) { $locationMenu = 'header menu top'; }
?>
<nav class="navbar navbar-default" role="navigation">
<div class="container-fluid">
@jerrylee
jerrylee / Replace Phone Numbers on Site
Created January 30, 2015 14:38
Replace Phone Numbers on Site
function replacePhoneNum($content) {
$content = str_replace('OLDNUM', 'NEWNUM', $content);
$content = str_replace('OLDNUM2', 'NEWNUM2', $content);
return $content;
}
add_filter( 'the_content', 'replacePhoneNum' );
@jerrylee
jerrylee / object errors
Created February 18, 2015 21:22
Object Errors
class AttorneySchema {
public $businessName = '';
public $phone = '';
public $street = '';
public $city = '';
public $state = '';
public $logo = '';
public $url = '';
public $map = '';
@jerrylee
jerrylee / Tab Tool
Created February 20, 2015 19:33
Tab Tool
<?php
/*
Easy to use Tabs maker for Bootsrap 3
*/
$tabone = $_POST['tabone'];
$tabtwo = $_POST['tabtwo'];
$tabthree = $_POST['tabthree'];
$tabfour = $_POST['tabfour'];
$tabcontentone = $_POST['tabcontentone'];
@jerrylee
jerrylee / Map Search List Results
Created May 4, 2015 13:54
List Results Code from Google Maps.
Javascript code:
MapsLib.prototype.displayList = function(json) {
var self = this;
var data = json['rows'];
var template = '';
var results = $('#results_list');
results.hide().empty(); //hide the existing list and empty it out first
@jerrylee
jerrylee / .gitignore
Last active August 29, 2015 14:26 — forked from jjeaton/.gitignore
WordPress root .gitignore. Ignore everything and then opt-in (exclude from the ignore) for your custom code.
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your