Skip to content

Instantly share code, notes, and snippets.

View germanny's full-sized avatar

Jen G germanny

View GitHub Profile
@germanny
germanny / content-kitchen-sink.html
Created March 13, 2012 20:25 — forked from ericrasch/content-kitchen-sink.html
HTML Kitchen Sink (taken from BlueTrip CSS Framework) includes the major (and minor) HTML tags you might use on any given site.
<h1>Level 1 heading</h1>
<p>Sed scelerisque sagittis lorem. Phasellus sodales. Nulla urna justo, vehicula in, suscipit nec, molestie sed, tellus.</p>
<h1 class="fancy">Level 1 heading class="fancy"</h1>
<p>Sed scelerisque sagittis lorem. Phasellus sodales. Nulla urna justo, vehicula in, suscipit nec, molestie sed, tellus.</p>
<h1 class="thin">Level 1 heading class="thin"</h1>
@germanny
germanny / dabblet.css
Created March 15, 2012 18:48 — forked from ericrasch/dabblet.css
Horizontal Type Line Behind Text
/**
* Horizontal Type Line Behind Text
* Inspired by this discussion @ CSS-Tricks: http://css-tricks.com/forums/discussion/comment/51357#Comment_51357
* Available on jsFiddle: http://jsfiddle.net/ericrasch/jAXXA/
* Available on Dabblet: http://dabblet.com/gist/2045198
* Available on GitHub Gist: https://gist.github.com/2045198
*/
h2 {
@germanny
germanny / dabblet.css
Created March 21, 2012 23:34 — forked from chriscoyier/dabblet.css
Untitled
.holder {
position: relative;
width: 215px;
height: 215px;
margin: 20px;
z-index: 999;
cursor: pointer;
}
.h1 {
@germanny
germanny / fb-comments.html
Created May 24, 2012 01:47 — forked from jimmynotjim/fb-comments.html
Adaptive sizing for FB comments plugin
<!-- New HTML5 FB Comments -->
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
@germanny
germanny / Page Custom Fields
Created August 10, 2012 02:07
Adds a custom meta box to certain Pages in the WP Page Editor (in this case, pages with template Degrees). Found the my_meta_init() function here: http://www.farinspace.com/page-specific-wordpress-meta-box/
<?php // https://gist.github.com/3310364
$page_custom_fields =
array(
"most_popular" => array(
"name" => "most_popular",
"std" => "",
"title" => "Most Popular Degree",
"description" => "",
"type" => "checkbox"),
@germanny
germanny / fn-post-custom-fields-infographic.php
Created October 3, 2012 14:21
Infographic standard form
<?php
$ig_post_custom_fields = array (
"infographic" => array(
"name" => "is_infographic",
"std" => "",
"title" => "Is this an infographic post?",
"description" => "If you check this box, we'll add a Pin It share option.",
"type" => "checkbox"),
"image_url" => array(
@germanny
germanny / inc-state-abbreviations.php
Created October 10, 2012 22:41
Responsive States Map. Includes states listing with abbreviations and AI file of the map. Uses both http://archive.plugins.jquery.com/project/maphilight and https://github.com/stowball/jQuery-rwdImageMaps. Requires the latest version of jQuery or you'll b
<?php
switch ($map_state)
{
case 'Alabama':
$abbr = 'AL';
break;
case 'Alaska':
$abbr = 'AK';
break;
@germanny
germanny / fn-page-custom-fields-monetization.php
Last active July 4, 2017 01:46
Custom Meta Box to Toggle Monetization
<?php // https://gist.github.com/3950382
function toggle_monetization() {
global $post;
$custom = get_post_custom($post->ID);
if(isset($custom["toggle_monetization"][0])) {
$money = $custom["toggle_monetization"][0];
}
?>
<p style="margin-bottom:10px;">
@germanny
germanny / vimeo_largest_image
Created October 26, 2012 22:38
Get Vimeo 1280px poster image
// Vimeo serves up poster images in 100, 200 and 640. But there's also size they don't serve: 1280
// https://developer.vimeo.com/apis/simple
$vimeo_value = get_post_meta($post->ID, 'vimeo_value', TRUE);
$vimeo_video_id = substr($vimeo_value, strrpos($vimeo_value, '/')+1); // get just the id
$vimeo_xml_file = unserialize(file_get_contents("http://vimeo.com/api/v2/video/$vimeo_video_id.php")); // get the video data from the API
$vimeo_video_width = $vimeo_xml_file[0]['width'];
$vimeo_thumbnail_large = $vimeo_xml_file[0]['thumbnail_large']; // load up one of the image sizes
if($vimeo_video_width < 1280) {
$vimeo_thumbnail = $vimeo_thumbnail_large;
@germanny
germanny / fn-videos.php
Created November 14, 2012 22:21
Updated video function, now including YouTube (and Vimeo)
<?php
function display_video($video_meta,$video_width,$video_height) {
$video_string = $video_meta; // url of the video; gonna use this to check if is a vimeo or youtube video
if( strpos($video_string, 'vimeo') ) {
/* =BEGIN: Insert Vimeo video from Custom Field ID
Source: http://wordpress.org/extend/plugins/lux-vimeo-shortcode/