Skip to content

Instantly share code, notes, and snippets.

<snippet>
<content><![CDATA[
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>${1:New Project Title}</title>
@trevorgreenleaf
trevorgreenleaf / Products Page
Created October 2, 2014 02:31
Products Page
<?php get_header();
/*
Template Name: Product Page
*/
?>
<div class="col-xs-12">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php
if( current_user_can('administrator')){
// show something to admins only
}
?>
@trevorgreenleaf
trevorgreenleaf / gist:3b0a00990e8866683e65
Created November 4, 2014 04:40
Using categories with the wp loop the manual way
<?php get_header();
/*
Template Name: Cats Grid Page
*/
?>
<p>Show the cats grid</p>
<div class="well"><ul>
<?php
@trevorgreenleaf
trevorgreenleaf / Basic CSS Btn Hover
Created November 25, 2014 03:37
Basic CSS Btn Hover
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Btn Hovers</title>
<style>
a.btn {
width:200px;
height: 200px;
@trevorgreenleaf
trevorgreenleaf / gist:87e93263ba08f24f198e
Created February 6, 2015 17:55
GIT: Clear out all local branches that have been merged into dev
git checkout dev && git branch --merged dev | grep -v "\* dev" | grep -v "staging" | xargs -n 1 git branch -d
@trevorgreenleaf
trevorgreenleaf / gist:06f9ae4c40d773acb047
Created April 30, 2015 03:32
English / Spanish Document
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>English / Spanish Document</title>
<style>
.menu {
background-color: #ccc;
list-style: none;
}
/*========== Mobile First Method ==========*/
/* Custom, iPhone Retina */
@media only screen and (min-width : 320px) {
}
/* Extra Small Devices, Phones */
@media only screen and (min-width : 480px) {
@trevorgreenleaf
trevorgreenleaf / tagCleaner
Created July 6, 2015 19:54
PHP tagCleaner
/**
* Send it a string of words and it will return
* @return array of clean tags
*/
protected function tagCleaner($tags = null){
// make lowercase
$tags = strtolower($tags);
// remove the crap
$tags = str_replace([',', '|', '/', '.', '#'], '', $tags);
// explod string at space into tags
@trevorgreenleaf
trevorgreenleaf / hex2rgb
Created July 6, 2015 19:56
HEX to RGB PHP
/**
* @return an array of rgb values
*/
protected function hex2rgb($hex = null ){
return sscanf($hex, "#%02x%02x%02x");
}