Skip to content

Instantly share code, notes, and snippets.

View richerimage's full-sized avatar

Richard Barratt richerimage

View GitHub Profile
@richerimage
richerimage / gist:dc45b49194117fd377f1
Last active August 29, 2015 14:21
replace_characters.js
<script id="replace_usd_for_stg">
jQuery(document).ready(function($) {
$(function() {
var selector = '.moonray-form-element-cart'; // use an id #if_you_can
var mystring = $(selector).html();
var output = mystring.replace(/\$/g, "£").replace(/\(USD\)/g, "\(STG\)");
$(selector).html(output);
});
});
</script>
@richerimage
richerimage / equal_height_columns
Created May 1, 2015 07:39
Equal Height Columns jQuery
if (ww > 768) {
equalheight = function(container){
var currentTallest = 0,
currentRowStart = 0,
rowDivs = new Array(),
$el,
topPosition = 0;
$(container).each(function() {
Order deny,allow
Deny from all
Allow from ##.###.###.###
Allow from ##.###.###.###
@richerimage
richerimage / add_fonts_to_Thesis 2.php
Last active August 29, 2015 14:17
Add fonts to Thesis 2
class dna_custom_class extends thesisdna {
public function __construct() {
add_filter('thesis_fonts', array($this, 'add_my_font'));
}
public function add_my_font($fonts) {
@richerimage
richerimage / add span around first word
Created January 7, 2015 14:52
Add Span Around First Word
<script>
jQuery(function($){
$.fn.firstWord = function() {
var text = this.text().trim().split(' ');
var first = text.shift();
this.html((text.length > 0 ? '<span class="title-highlight">'+ first + '</span> ' : first) + text.join(' '));
};
$('h1').firstWord();
});
</script>
@richerimage
richerimage / jQuery after page load
Created December 21, 2014 11:43
Use the following code instead to execute code only when everything on the page has loaded, including images.
$(window).bind("load", function() {
//YOUR CODE
});
@richerimage
richerimage / Client Testimonial Taxonomy
Last active August 29, 2015 14:10
Client Testimonial Taxonomy
// Register Custom Taxonomy
function testimonials_taxonomy() {
$labels = array(
'name' => _x( 'Sectors', 'Taxonomy General Name', 'thesis_dna' ),
'singular_name' => _x( 'Sector', 'Taxonomy Singular Name', 'thesis_dna' ),
'menu_name' => __( 'Sector', 'thesis_dna' ),
'all_items' => __( 'All Sectors', 'thesis_dna' ),
'parent_item' => __( 'Parent Sector', 'thesis_dna' ),
'parent_item_colon' => __( 'Parent Sector:', 'thesis_dna' ),
@richerimage
richerimage / YouTube Minimal Branding
Created November 22, 2014 11:02
You Tube Minimal Branding
Append the following to the url: ?modestbranding=1;autohide=1&amp;showinfo=0&amp;controls=1&amp;autoplay=0&amp;rel=0
@richerimage
richerimage / Add Image Sizes
Created October 20, 2014 15:04
Add Image Sizes
class dna_custom_class extends thesisdna {
public function __construct() {
add_image_size('Letterbox', 460, 258, true );
add_filter('image_size_names_choose', array($this, 'my_custom_sizes'));
}