Skip to content

Instantly share code, notes, and snippets.

@cramdesign
cramdesign / toggle.js
Last active August 29, 2015 14:01
A simple javascript function to toggle a class on/off. No need for jquery to build a simple responsive menu or somewhat.
toggleClass = function( el, className ) {
if ( el.classList ) {
el.classList.toggle( className );
} else {
var classes = el.className.split( ' ' );
var existingIndex = classes.indexOf( className );
<?php
/**
* Hide editor on specific pages.
*
*/
function hide_editor() {
global $pagenow;
if( !( 'post.php' == $pagenow ) ) return;
@cramdesign
cramdesign / gallery-style.css
Created April 16, 2014 23:50
WordPress 3.9 ships with the ability to add HTML5 support for galleries which will now use figure and figcaption to display images. This is a huge change for the better! Bonus: br tag used for clearing rows has been cleaned out as well. While all of this is good news for more semantic markup, one might now be left wondering how to style the new …