Skip to content

Instantly share code, notes, and snippets.

View emaildano's full-sized avatar
🏄‍♀️
Surfing the information superhighway

Dano emaildano

🏄‍♀️
Surfing the information superhighway
  • Philadelphia, PA
View GitHub Profile
<?php
/**
* This code is intended to be added to your wp-config.php file just below the top comment block.
* It should replace the existing define('DB_*') statements. You can add or remove sections
* depending on the number of environments you intend to setup. You should change all values of
* DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST for each environment, making them all distinct
* for security purposes.
*/
// determine the current environment
@emaildano
emaildano / Add Custom Roots Theme Scripts
Created November 3, 2013 18:17
Custom Script Support for Roots http://roots.io/
function custom_scripts() {
wp_enqueue_style('roots_custom', get_template_directory_uri() . '/assets/css/app.css');
}
add_action('wp_enqueue_scripts', 'custom_scripts', 200);
@emaildano
emaildano / JQuery 100% Div Height
Created November 3, 2013 23:02
JQuery 100% div window height with min-height
jQuery(document).ready(function() {
$("#intro").height($(window).height());
$(window).resize(function() {
$("#intro").minHeight($(window).height());
$("#intro").css("min-height", "600px");
});
});
@emaildano
emaildano / Vertically Center Div
Created November 4, 2013 02:15
Vertically Center Div
var parentHeight = $('#parent').height();
var childHeight = $('#child').height();
$('#child').css('margin-top', (parentHeight - childHeight) / 2);
@emaildano
emaildano / scroll-with-class.html
Last active December 27, 2015 08:39
Create .scroll class to use with jQuery ease and anchor tags / links
<a id="introArrow" href="#about" class="scroll"><i class="fa fa-angle-down fa-5x"></i></a>
<div class="text-center" id="about"></div>
@emaildano
emaildano / Scroll To Top On Page Load
Created November 12, 2013 01:55
Scroll to top of page on load.
$(window).unload(function() {
$('body').scrollTop(0);
});
@emaildano
emaildano / List Thumbnail Sizes
Created November 27, 2013 05:45
List Thumbnail Sizes
<?php function list_thumbnail_sizes(){
global $_wp_additional_image_sizes;
$sizes = array();
foreach( get_intermediate_image_sizes() as $s ){
$sizes[ $s ] = array( 0, 0 );
if( in_array( $s, array( 'thumbnail', 'medium', 'large' ) ) ){
$sizes[ $s ][0] = get_option( $s . '_size_w' );
$sizes[ $s ][1] = get_option( $s . '_size_h' );
}else{
if( isset( $_wp_additional_image_sizes ) && isset( $_wp_additional_image_sizes[ $s ] ) )
@emaildano
emaildano / WP Terms Array (Singular and Plural)
Created December 10, 2013 21:58
Get Wordpress terms array with singular or plural term title functions.
<?php
// Get terms for post
// define category slug and name
$category = 'journals'; // Taxonomy Name
$categoryName = 'Journals'; // Front-end / Plural Name
$categorySingle = 'Journal'; // Front-end Singular Name
// end definition
$terms = get_the_terms( $post->ID , $category );
$(window).resize(function() {
$('#content').height($(window).height() - 46);
});
$(window).trigger('resize');
@emaildano
emaildano / Bootstrap Tab LInks
Created December 19, 2013 17:02
Enable links to open Bootstrap tabs.