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 | |
//[imagedir] | |
function image_directory() { | |
return get_stylesheet_directory_uri() . '/images/'; | |
} | |
add_shortcode('imagedir', 'image_directory'); | |
//[homeurl] | |
function home_url_shortcode() { |
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
//http://stackoverflow.com/questions/2901102/how-to-print-a-number-with-commas-as-thousands-separators-in-javascript | |
function numberWithCommas(x) { | |
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); | |
} |
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
//Taken from: http://csswizardry.com/2012/02/pragmatic-practical-font-sizing-in-css/ | |
/* Housekeeping */ | |
*{ margin:0; padding:0; } | |
/* Define your base font-size here; most elements will inherit this. */ | |
html{ | |
font-size:1em; /* Assuming 16px... */ | |
line-height:1.5; /* 24px (This is now our magic number; all subsequent margin-bottoms and line-heights want to be a multiple of this number in order to maintain vertical rhythm.) */ | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Idiom Test - Slider</title> | |
<style type="text/css"> | |
.wrapper { | |
position: relative; | |
width: 100%; | |
height: 500px; |
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
var checkIfExists = function(id) { | |
if (document.getElementById(id)) { | |
return true; | |
} | |
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 $imgdata = wp_get_attachment_image_src( get_post_thumbnail_id(), "full"); | |
$imgurl = $imgdata[0]; // the url of the thumbnail picture | |
$imgwidth = $imgdata[1]; // thumbnail's width | |
$imgheight = $imgdata[2]; // thumbnail's height | |
if ($imgheight > 0) { | |
$ratio = $imgwidth / $imgheight; | |
} else { | |
$ratio = 1; | |
} | |
?> |
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
//http://stackoverflow.com/questions/13279725/getting-a-sticky-header-to-push-up-like-in-instagrams-iphone-app-using-css-a | |
function stickyTitles(stickies) { | |
this.load = function() { | |
stickies.each(function(){ | |
var thisSticky = jQuery(this).wrap('<div class="followWrap" />'); | |
thisSticky.parent().height(thisSticky.outerHeight()); |
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
//Paul Irish - http://www.broken-links.com/2009/01/20/very-quick-equal-height-columns-in-jquery/ | |
$.fn.setAllToMaxHeight = function(){ | |
return this.height( Math.max.apply(this, $.map( this , function(e){ return $(e).height() }) ) ); | |
} |
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
//In my base scss file I copied and pasted the css from the location field plugin | |
.location_dl {margin-left:10px;} | |
.location_dl::after | |
{ | |
content:""; | |
display:table; | |
clear:both; | |
} | |
.location_dt-address, |
NewerOlder