This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// using http://codex.wordpress.org/Function_Reference/wp_remote_get and http://codex.wordpress.org/Transients_API | |
// if transient has expired then recreate, if not grab from db | |
if ( false === ( $featured_trans = get_transient( 'featured_trans' ) ) ) { | |
$featured_args = array( | |
'timeout' => 5, | |
'redirection' => 5, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// validate email address from form, good for email newsletter signup | |
$( 'form input.submit' ).click(function() { | |
var email_address = $( 'form input.email' ).val(); | |
if ( /(.+)@(.+){2,}\.(.+){2,}/.test( email_address ) ) { | |
return true; | |
} else { | |
alert( 'Invalid Email Address' ); | |
return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// using http://codex.wordpress.org/Function_Reference/wp_enqueue_script | |
// basic enqueue script | |
add_action( 'wp_enqueue_scripts', 'load_scripts' ); | |
function load_scripts() { | |
wp_register_script( 'functions-js', get_stylesheet_directory_uri() . '/_/js/functions.js', array(), '', true ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// hide broken images | |
$( '.post img' ).each(function () { | |
var img = $(this); | |
var src = img.attr( 'src' ).split( '/' ); | |
var file = src[src.length - 1]; | |
if( file == "x.gif" ) { | |
img.hide(); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.video-container { | |
width: 100%; | |
position: relative; | |
padding-bottom: 56.25%; /* 16:9 */ | |
padding-top: 25px; | |
height: 0; | |
} | |
.video-container iframe { | |
position: absolute; | |
top: 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* this is based off of http://cobyism.com/gridism/ */ | |
/* responsive grid setup - going mobile first here | |
-------------------------------------------------------------------------------*/ | |
.grid { | |
display: block; | |
clear: both; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Compiled source # | |
################### | |
*.com | |
*.class | |
*.dll | |
*.exe | |
*.o | |
*.so | |
# Packages # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nav form .search-field { | |
border: 0; | |
} | |
nav form .search-submit { | |
font-family: 'FontAwesome'; | |
border: 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$conn = mysql_connect( "host", "user", "pass" ); | |
if ( !$conn ) { | |
echo "Unable to connect to server."; | |
} else { | |
$db = mysql_select_db( "database", $conn ); | |
if ( !$db ) { | |
echo "Unable to select database."; |
OlderNewer