Skip to content

Instantly share code, notes, and snippets.

View thadallender's full-sized avatar

Thad Allender thadallender

View GitHub Profile
@thadallender
thadallender / example-functionality-plugin
Last active August 29, 2015 13:58
Example WordPress Functionality Plugin
<?php
/**
* Plugin Name: Example Functionality Plugin
* Plugin URI: http://your-website.com
* Description: An example functionality for housing your actions and filters.
* Version: 1.0
* Author: Your Name
* License: GPL2
*/
@thadallender
thadallender / sell-media-above-cart-items-hook
Last active August 29, 2015 13:58
Sell Media Above Cart Item Form Action Hook
function my_sell_media_above_item_form(){
echo 'This text will show up between the product thumbnail and the size and license select boxes on the cart popup.';
}
add_action( 'sell_media_above_item_form', 'my_sell_media_above_item_form' );
@thadallender
thadallender / sell-media-cart-quantity
Created April 9, 2014 00:51
Show cart quantity for Sell Media
Checkout (<span class="sellMediaCart_quantity">0</span>)
@thadallender
thadallender / sell-media-menu-cart-total
Created April 9, 2014 00:48
Show checkout link with current cart total
Checkout <span class="sellMediaCart_total"></span>
@thadallender
thadallender / customize-sell-media-continue-shopping.php
Last active August 29, 2015 13:58
To customize the "continue shopping" text on the Sell Media checkout page, paste this code into your active theme's functions.php or create your own plugin with your tweaks containing this code.
<?php
/**
* Plugin Name: Sell Media Continue Shopping Filter
* Plugin URI: https://graphpaperpress.com/plugins/sell-media/
* Description: Filter to Sell Media "Continue shopping" links
* Version: 1.0.0
* Author: Thad Allender
* Author URI: https://graphpaperpress.com
* Author Email: support@graphpaperpress.com
* Text Domain: sell_media
@thadallender
thadallender / Resize WordPress images dynamically
Created March 27, 2014 23:46
Resize WordPress images on the fly using core functions
/**
* Resize an image to specified dimensions
* @return (string) path to product image or feature image
*/
function my_resize_image( $post_id=null, $width=null, $height=null, $crop=true ) {
// get path to featured image
$featured_image_id = get_post_thumbnail_id( $post_id );
$featured_image_path = get_attached_file( $featured_image_id );
@thadallender
thadallender / style.css
Created February 20, 2014 19:21
WordPress child theme style.css
/*
Theme Name: Stock Photography Child
Theme URI: http://graphpaperpress.com/themes/stock-photography-child/
Description: Stock Photography Child Theme
Author: Thad Allender
Author URI: http://thadallender.com
Template: stock-photography
Version: 1.0.0
Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
Text Domain: stock-photography-child
@thadallender
thadallender / customize-grid
Created February 5, 2014 20:24
Grid tweak for 6 items in Storyteller
.fromblog-post, .blog-grid .hentry {
width: 32%;
}
.fromblog-post:nth-child(3n+1){
clear:left;
}
@thadallender
thadallender / 5-col-grid-sell-media
Created February 3, 2014 22:21
Change from a 3 column to 5 column grid for Sell Media archives
.sell-media .sell-media-grid { width: 18%; }
.sell-media .sell-media-grid:nth-child(5n) { margin-right: 0; }
.sell-media .sell-media-grid:nth-child(3n), .sell-media .sell-media-grid .end { margin-right: 2%; }
.sell-media .sell-media-grid:nth-child(5n+1) { clear: left; }
.sell-media .sell-media-grid:nth-child(3n+1) { clear: none; }
@thadallender
thadallender / wp-change-read-more
Created January 21, 2014 04:10
Use this to change the read more text in WordPress. Change &hellip; to anything you want. Add this snippet to your theme's functions.php file.
function new_excerpt_more( $more ) {
return '&hellip;';
}
add_filter( 'excerpt_more', 'new_excerpt_more' );