Skip to content

Instantly share code, notes, and snippets.

View thadallender's full-sized avatar

Thad Allender thadallender

View GitHub Profile
@thadallender
thadallender / vs-wp-starter-content.php
Last active February 26, 2021 07:39
WordPress theme starter content with custom post type and postmeta integration
<?php
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function aperture_setup() {
@thadallender
thadallender / sell-media-keyword-migration.php
Created November 3, 2016 02:32
Sell Media Keyword Migration
<?php
/**
* Plugin Name: Sell Media Keyword Migration
* Plugin URI: http://graphpaperpress.com/
* Description: An extension for migrating keywords in Sell Media to attachments
* Version: 1.0.0
* Author: Graph Paper Press
* Author URI: http://graphpaperpress.com
* Author Email: support@graphpaperpress.com
* License: GPL
@thadallender
thadallender / tw-purchase-text.php
Created October 15, 2016 14:43
Theme.Works change Purchase text
<?php
/**
* Changes the purchase text in Theme.Works e-commerce homepage section
*/
function tw_change_ecommerce_purchase_text() {
return 'bestel';
}
add_filter( 'tw_ecommerce_purchase_text', 'tw_change_ecommerce_purchase_text' );
@thadallender
thadallender / sell-media-below-buy-button.php
Last active August 25, 2016 04:35
Show a link to checkout below the buy button for Sell Media
<?php
/**
* Plugin Name: Sell Media Below Buy Button
* Plugin URI: http://graphpaperpress.com/plugins/sell-media/
* Description: An example below button code plugin for Sell Media.
* Version: 1.0
* Author: Graph Paper Press
* Author URI: http://graphpaperpress.com
* Author Email: support@graphpaperpress.com
* Text Domain: sell_media
@thadallender
thadallender / sell-media-manual-purchase-filter-text.php
Created August 1, 2016 20:14
Sell Media - Filter "Manual Purchase" text
<?php
/**
* Filter the "Manual Purchase" text shown on the Checkout page
*/
function sell_media_manual_purchases_filter_text(){
return 'Cash/Check';
}
add_filter( 'sell_media_manual_purchases_text', 'sell_media_manual_purchases_filter_text' );
@thadallender
thadallender / sell-media-custom-item-shortcode.php
Last active March 1, 2016 00:24
Remove default Sell Media shortcode [sell_media_item] and replace with a custom version
<?php
/**
* Plugin Name: My Sell Media Shortcode
* Plugin URI: http://graphpaperpress.com/plugins/sell-media/
* Description: An example shortcode plugin for Sell Media.
* Version: 1.0
* Author: Graph Paper Press
* Author URI: http://graphpaperpress.com
* Author Email: support@graphpaperpress.com
* Text Domain: sell_media
@thadallender
thadallender / sell-media-custom-text-filters.php
Created February 14, 2016 16:13
Changes Sell Media's terms of service label on Checkout page.
<?php
/**
* Add the following function to your own functionality plugin
* or add it to your theme's functions.php file.
* Change any of the text inside the return value.
*/
function my_sell_media_tos_label() {
return 'Hey this is my custom text. Please agree to our <a href="javascript:void(0);" class="sell-media-empty-dialog-trigger">terms of service</a>.';
}
@thadallender
thadallender / allow-my-custom-host.php
Created December 3, 2015 19:02
Filter for allowing local theme and plugin repo updates (for testing, never us on production site)
<?php
/** Enable my local themes and plugins repository FFS!!! */
function allow_my_custom_host( $allow, $host, $url ) {
if ( $host == 'put-your-repository-domain-here.com' )
$allow = true;
return $allow;
}
add_filter( 'http_request_host_is_external', 'allow_my_custom_host', 10, 3 );
@thadallender
thadallender / vanishing-message.css
Created November 11, 2015 16:42
Vanishing welcome message
.vanishing-message {
position: relative;
}
.vanishing-message img {
width: 100%;
height: auto;
display: block;
}
<div class="vanishing-message">
<img src="https://images.graphpaperpress.com.s3.amazonaws.com/sky-2400x1200.jpeg" />
<div class="text">
<span class="prelude">Commercial / Editorial / Advertising</span>
<span class="desc">Photography by Grant Smith</span>
</div>
</div>