Skip to content

Instantly share code, notes, and snippets.

View SeanChDavis's full-sized avatar
👋
Reach out.

Sean Christopher Davis SeanChDavis

👋
Reach out.
View GitHub Profile
@SeanChDavis
SeanChDavis / gist:ad2e14a9b6f8e1193de4
Created September 9, 2014 02:04
EDD Move Points & Rewards Below Content
if ( class_exists( 'EDD_Points_Renderer' ) ) {
global $edd_points_render;
remove_action( 'edd_before_download_content', array( $edd_points_render, 'edd_points_message_content' ), 10 );
add_action( 'edd_after_download_content', array( $edd_points_render, 'edd_points_message_content' ), 0 );
}
@SeanChDavis
SeanChDavis / gist:9df26c2305e9fed11100
Created September 10, 2014 13:09
EDD Store Front Display Category (or Tag)
<div class="products inner">
<div class="products-container clearfix">
<?php if ($products->have_posts()) : $i = 1; ?>
<?php while ($products->have_posts()) : $products->the_post(); ?>
<div class="product-box product<?php if($i % 4 == 0) { echo ' last'; } ?> border-box">
<div class="product-frame">
<a class="product-title" href="<?php the_permalink(); ?>">
<h2><?php the_title(); ?></h2>
</a>
<a href="<?php the_permalink(); ?>">
<?php // DO NOT COPY THIS LINE
function sd_custom_downloads_excerpt( $post_excerpt ) {
$post_excerpt .= '<a href="' . get_the_permalink() . '">More</a>';
return $post_excerpt;
}
add_filter( 'edd_downloads_excerpt', 'sd_custom_downloads_excerpt' );
@SeanChDavis
SeanChDavis / gist:e9b94d2472eec107df17
Created November 1, 2014 20:14
EDD Modify Commissions Email Template
<?php // do NOT copy this opening PHP tag
/**** COPY AND PASTE EVERYTHING BELOW ****/
/**
* Remove default email template
*/
remove_action( 'eddc_insert_commission', 'eddc_email_alert', 10, 5 );
/**
* Build New email template for Commissions
@SeanChDavis
SeanChDavis / gist:b99b497f10cd1b1cf64d
Last active May 31, 2017 16:49
EDD Points & Rewards - message placement
<?php // don't copy this line
// Change callback function for points message
if ( class_exists( 'EDD_Points_Renderer' ) ) {
// remove default points message
remove_action( 'edd_before_download_content', array( $edd_points_render, 'edd_points_message_content' ), 10 );
// call new points message function
add_action( 'edd_before_download_content', 'sd_custom_points_message', 10 );
@SeanChDavis
SeanChDavis / gist:f54fe89d192905ef10b9
Last active August 29, 2015 14:09
EDD "Already Logged In" message for [edd_register]
<?php // DO NOT COPY THIS LINE
/**
* Show message instead of registration form [edd_register] when user is logged in
*/
function sd_already_registered_message() {
if ( is_user_logged_in() ) {
// custom message
$message = "You're already logged in.";
@SeanChDavis
SeanChDavis / gist:a6fdc48a7e710d7e2be7
Last active August 29, 2015 14:12
EDD show automatic purchase button below content on download category archives
<?php // DO NOT COPY THIS LINE
/**
* remove original filter that adds purchase button below download content
*/
remove_filter( 'the_content', 'edd_after_download_content' );
/**
* add new filter that adds "is_archive()" to the conditional so
* that the button will also show on downloads archives
<div id="search-2" class="widget widget_search">
<h3>SEARCH</h3>
<form method="get" id="searchform" action="http://curlsunderstood.com/" role="search">
<input type="text" name="s" id="s" value="NEW TEXT" onfocus="if(this.value=='NEW TEXT')this.value='';" onblur="if(this.value=='')this.value='NEW TEXT';" />
<button type="submit">
<i class="icon-search"></i>
</button>
</form>
</div>
<?php
/**
* The Sidebar containing the main widget areas.
*
* @package SimpleMag
* @since SimpleMag 1.4
**/
global $ti_option;
?>
@SeanChDavis
SeanChDavis / gist:c66a608b613cf69fa9ae
Created January 20, 2015 17:11
FES Submission Form Success Redirect
<?php // DON'T COPY THIS LINE
function sd_fes_submission_redirect( $response, $post_id, $form_id ) {
$response['redirect_to'] = 'http://SITEURL.com/';
return $response;
}
add_filter( 'fes_add_post_redirect', 'sd_fes_submission_redirect', 10, 3 );