Skip to content

Instantly share code, notes, and snippets.

View thunderdunk's full-sized avatar

Dan Sweet thunderdunk

View GitHub Profile
@thunderdunk
thunderdunk / hc-wp-page-content-check.php
Last active January 5, 2016 17:36
WP Page Content Check
//Only build content container if there is content in the editor
function hc_page_content() {
$contentcheck = get_the_content();
if($contentcheck != '') { ?>
<div class="container">
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<body>
<h1>Blank Document</h1>
<p>The content of the document...</p>
</body>
@thunderdunk
thunderdunk / gist:ea58c6465aa5573f5715
Created April 22, 2015 17:37
Flexbox prefixes mixin
@mixin flexbox() {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
}
@mixin flex($values) {
-webkit-box-flex: $values;
@thunderdunk
thunderdunk / gist:870778e737918c880372
Last active August 29, 2015 14:18
Remove Heading 1 from TinyMCE
<?php
/**
* Remove Heading 1 from TinyMCE Editor
**/
add_filter('tiny_mce_before_init', 'tiny_mce_remove_unused_formats' );
function tiny_mce_remove_unused_formats($init) {
// Add block format elements you want to show in dropdown
$init['block_formats'] = 'Paragraph=p;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Address=address;Pre=pre';
return $init;
}
function heptagon_get_svg($svg){
$path = get_stylesheet_directory­().'/images­/svgs/'.$svg;
if(file_exists($path)){
return file_get_contents($path);­
} return '';
}
<?php $mb->the_field('meta-state'); ?>
<select name="<?php $mb->the_name(); ?>" size="1">
<option selected value="">State...</option>
<option value="None">None</option>
<option value="">-- UNITED STATES --</option>
<option value="Alabama" <?php $mb->the_select_state('Alabama'); ?>>Alabama</option>
<option value="Alaska" <?php $mb->the_select_state('Alaska'); ?>>Alaska</option>
<option value="Arizona" <?php $mb->the_select_state('Arizona'); ?>>Arizona</option>
<option value="Arkansas" <?php $mb->the_select_state('Arkansas'); ?>>Arkansas</option>
<option value="California" <?php $mb->the_select_state('California'); ?>>California</option>
@thunderdunk
thunderdunk / .gitignore
Last active August 29, 2015 14:07 — forked from redoPop/.gitignore
# Ignore everything in the root except the "wp-content" directory.
/*
!.gitignore
!wp-content/
# Ignore everything in the "wp-content" directory, except the "plugins"
# and "themes" directories.
wp-content/*
!wp-content/plugins/
!wp-content/themes/
<html>
<head>
<title>Select styles with CSS only</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
background-color: #fff;
font-family: helvetica, sans-serif;
margin: 4% 10%
}