Skip to content

Instantly share code, notes, and snippets.

View thadallender's full-sized avatar

Thad Allender thadallender

View GitHub Profile
@thadallender
thadallender / jquery-vanishing-message-scroll.js
Last active November 11, 2015 16:45
Vanishing welcome message on scroll. Tutorial here: https://graphpaperpress.com/?p=74953
jQuery( document ).ready( function( $ ) {
// This is where we apply opacity to the intro overlay
$( window ).scroll( function() {
// Hide the overlay if user has scrolled past 1px from top
if ( $( window ).scrollTop() >= 1 ) {
$( '.vanishing-message' ).removeClass('has-overlay');
$( '.vanishing-message .text' ).css( 'opacity', 0 );
}
@thadallender
thadallender / sell-media-image-size-filter.php
Created August 14, 2015 13:12
Filter to Sell Media that adds a new image size for a new image aspect ratio used in Sell Media archives and shortcodes
<?php
/**
* Plugin Name: Sell Media Image Size Filter
* Plugin URI: https://graphpaperpress.com/plugins/sell-media/
* Description: Filter to Sell Media that adds a new image size for a new image aspect ratio used in Sell Media archives and shortcodes
* Version: 1.0.0
* Author: Thad Allender
* Author URI: https://graphpaperpress.com
* Author Email: support@graphpaperpress.com
* Text Domain: sell_media
@thadallender
thadallender / sell-media-prints-filter.php
Created July 9, 2015 21:56
Filter for Sell Media "Prints" text
<?php
/**
* Filter for prints text
*/
function sell_media_print_text_filter(){
return 'books';
}
add_filter( 'sell_media_print_text', 'sell_media_print_text_filter' );
<?php
/**
* Remove the default Sell Media action.
* We'll replace it with our own custom action hook below.
*/
remove_action( 'sell_media_before_content', 'sell_media_append_media' );
/**
* Add our new action hook to alter the media (featured image, etc) before the_content in Sell Media
@thadallender
thadallender / gist:9c73546ebd01e3782fe3
Created April 30, 2015 12:57
Add classes to images on single entries in Sell Media
<?php
/**
* Add more classes to main images appearing on single entries in Sell Media.
* Change 'lightbox' below to whatever classes you want to add.
*/
function sell_media_filter_single_image_class( $classes ) {
if ( is_singular( 'sell_media_item' ) ) {
$classes[] = 'lightbox';
@thadallender
thadallender / themeworks-custom-social-media.php
Created January 6, 2015 03:09
A plugin to add custom social media links to Theme.Works themes https://theme.works
<?php
/**
* Plugin Name: Theme.Works Custom Social Media
* Plugin URI: https://theme.works
* Description: A plugin for adding additional social media links to all Theme.Works themes
* Version: 1.0.0
* Author: Thad Allender
* Author URI: https://theme.works
* Author Email: info@theme.works
@thadallender
thadallender / themeworks-theme-mods.php
Last active February 11, 2016 09:38
Theme.Works Theme Mods - A plugin to change text strings on the homepage
<?php
/**
* Plugin Name: Theme.Works Theme Mods
* Plugin URI: http://theme.works
* Description: Adds your custom filters to an Theme.Works theme.
* Version: 1.0.0
* Author: Thad Allender
* Author URI: http://theme.works
* Author Email: info@theme.works
@thadallender
thadallender / tw_grid cols=4
Created September 3, 2014 00:04
Theme.Works Shortcode - Four Column Grid
[tw_grid cols="4"]Ut enim ad minim veniam,quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodoconsequat. Duis aute irure dolor in reprehenderit in voluptate velit essecillum dolore eu fugiat nulla pariatur.[/tw_grid][tw_grid cols="4"]Ut enim ad minim veniam,quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodoconsequat. Duis aute irure dolor in reprehenderit in voluptate velit essecillum dolore eu fugiat nulla pariatur.[/tw_grid][tw_grid cols="4"]Ut enim ad minim veniam,quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodoconsequat. Duis aute irure dolor in reprehenderit in voluptate velit essecillum dolore eu fugiat nulla pariatur.[/tw_grid][tw_grid cols="4"]Ut enim ad minim veniam,quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodoconsequat. Duis aute irure dolor in reprehenderit in voluptate velit essecillum dolore eu fugiat nulla pariatur.[/tw_grid]
@thadallender
thadallender / tw_grid cols=3
Created September 3, 2014 00:03
Theme.Works Shortcode - Three column grid
[tw_grid cols="3"]Ut enim ad minim veniam,quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodoconsequat. Duis aute irure dolor in reprehenderit in voluptate velit essecillum dolore eu fugiat nulla pariatur.[/tw_grid][tw_grid cols="3"]Ut enim ad minim veniam,quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodoconsequat. Duis aute irure dolor in reprehenderit in voluptate velit essecillum dolore eu fugiat nulla pariatur.[/tw_grid][tw_grid cols="3"]Ut enim ad minim veniam,quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodoconsequat. Duis aute irure dolor in reprehenderit in voluptate velit essecillum dolore eu fugiat nulla pariatur.[/tw_grid]
@thadallender
thadallender / tw_grid cols=2
Created September 3, 2014 00:02
Theme.Works Shortcode - Two Column Grid
[tw_grid cols="2"]Ut enim ad minim veniam,quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodoconsequat. Duis aute irure dolor in reprehenderit in voluptate velit essecillum dolore eu fugiat nulla pariatur.[/tw_grid][tw_grid cols="2"]Ut enim ad minim veniam,quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodoconsequat. Duis aute irure dolor in reprehenderit in voluptate velit essecillum dolore eu fugiat nulla pariatur.[/tw_grid]