Skip to content

Instantly share code, notes, and snippets.

View thadallender's full-sized avatar

Thad Allender thadallender

View GitHub Profile
@thadallender
thadallender / sell-media-filter-post-status.php
Created May 21, 2014 17:02
Filter Sell Media add bulk and add package post status
/**
* Filter the post status of newly created Sell Media items
* Applies only to Add Bulk and Add Package features
* Useful if you don't want contributors to publish new items
* Without first being approved
*/
function my_sell_media_post_status(){
if ( current_user_can( 'manage_options' ) ) {
return 'publish';
} else {
@thadallender
thadallender / jquery-filter-items
Created June 10, 2014 19:49
jQuery filter a list of items using data attributes and classes on the item
jQuery(document).ready(function($){
$('.filter').on('click', function(){
var cat = $(this).data('filter');
$('.item').each(function(){
if($(this).hasClass(cat)){
$(this).show().removeClass('hide').addClass('show');
} else {
$(this).hide().removeClass('show').addClass('hide');
}
});
@thadallender
thadallender / sell-media-filter-thumbnail-size.php
Created July 9, 2014 20:30
Filter Sell Media Thumbnail Size
<?php
/**
* Filters the size of thumbnail in Sell Media
*/
function sell_media_filter_thumbnail_size(){
return 'large';
}
add_filter( 'sell_media_thumbnail', 'sell_media_filter_thumbnail_size' );
@thadallender
thadallender / tw_contact_form
Last active August 29, 2015 14:06
Theme.Works Shortcode - Contact Form
[tw_contact_form]
@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]
@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=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 / 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 / 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 / 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';