Skip to content

Instantly share code, notes, and snippets.

@bryceadams
bryceadams / gist:3727860
Created September 15, 2012 13:25
Doci - edd_post_update_discount
do_action( 'edd_post_update_discount', $discount_details, $id );
@bryceadams
bryceadams / gist:3732870
Created September 16, 2012 15:35
Add excerpt support to downloads post type
// Add excerpt support to downloads post type
add_action( 'init', 'bla_excerpt_support' );
function bla_excerpt_support() {
add_post_type_support( 'download', 'excerpt' );
}
@bryceadams
bryceadams / gist:3741187
Created September 18, 2012 04:04
Easy Timer SHortcode
[counter date=YYY/MM/DD-hh:mm:ss]
Just [remaining-timer] until this film comes out in cinemas!
[after]For [elapsed-timer], this film is released in cinemas![/counter]
@bryceadams
bryceadams / gist:3785804
Created September 26, 2012 03:22
JB Image 1
<!-- copy the following line for the first one -->
<img src="/wp-content/themes/jackblack/images/whatsinit.png" />
<!-- and copy the next line for the second one -->
<img src="/wp-content/themes/jackblack/images/howandwhen.png" />
@bryceadams
bryceadams / gist:3806335
Created September 30, 2012 09:33
Add Image Sizes to Media Insert Dialog / Thickbox
add_image_size( 'example', 500, 100, false );
// Add Logo Size to Media Upload Dialog
add_filter( 'image_size_names_choose', 'namespace_image_size_names_choose' );
function namespace_image_size_names_choose( $image_sizes ) {
$image_sizes['example'] = __( 'What You Want The Image Size To Be Called In The Media Uploader', 'namespace' );
return $image_sizes;
}
@bryceadams
bryceadams / gist:3843548
Last active October 11, 2015 10:17
Custom Download Templates Filter
<?php
/**
* Allow Custom Post Templates for Downloads (in Easy Digital Downloads)
**/
function my_cpt_post_types( $post_types ) {
$post_types[] = 'download';
return $post_types;
}
add_filter( 'cpt_post_types', 'my_cpt_post_types' );
@bryceadams
bryceadams / gist:3843580
Created October 6, 2012 02:48
Custom Download Templates Header
<?php
/*
Template Name Posts: Name Of Your Template
*/
?>
@bryceadams
bryceadams / gist:3843723
Created October 6, 2012 03:53
Add TypeKit Code To Head In Child Theme
// Add TypeKit <head> Code
function childtheme_typekit() { ?>
<script type="text/javascript" src="//use.typekit.net/t12xau3f.js"></script>
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
<?php }
add_action( 'wp_head', 'childtheme_typekit' );
@bryceadams
bryceadams / gist:3847117
Created October 7, 2012 04:37
Mail Chimp CSS3 Button - Red Small
<a href="#" class="btn small red">I'm a Sexy Button</a>
@bryceadams
bryceadams / gist:3847129
Created October 7, 2012 04:43
Mail Chimp CSS3 Button - Red Normal
<a href="#" class="btn red">That Other Button Has Nothing On Me</a>