Skip to content

Instantly share code, notes, and snippets.

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

Sean Davis SeanTOSCD

👋
Reach out.
View GitHub Profile
@SeanTOSCD
SeanTOSCD / vol header top
Last active December 15, 2015 08:09
Building manual header in Volatyl
// Add logo to the header
function header_logo() {
/*
* When manually building a site title (or tagline), you have to consider SEO.
* On the homepage of your site, and other select pages, you'll want your title
* to be wrapped in H1 tags. On other pages, though, like a single post article,
* wrapping your title and tagline in a <span> or <p> is perfectly fine because
* the article title is now the most important headline on the page.
*
* So what this code does is first present a conditional saying:
@SeanTOSCD
SeanTOSCD / wp-buttons.css
Last active December 7, 2023 21:45
WordPress Admin Style Buttons
/*
wp admin style buttons:
To use for links styled as buttons, add a class attribute to the
<a> tag and add "button" as a value. This sets up the basic button
structure. Then you choose which button you want to use. Add a
value of "blue" for the blue button or "gray" for the gray button.
Ex. <a href="#" class="button blue">Blue Button</a>
*/
@SeanTOSCD
SeanTOSCD / 404.php
Last active December 23, 2015 03:38
Custom 404 template for Volatyl - CREATE a file in the ROOT of your Volatyl CHILD THEME and name it 404.php. Paste the code below into that file. This works for both Volatyl and Volatyl for EDD.
<?php
/** 404.php
*
* custom layout for 404 error pages -- place this file in the
* root of your child theme and WordPress will use it instead of the
* original 404 template. Edit this file as you wish!
*/
$options_structure = get_option('vol_structure_options');
<?php
/**
* The Template for displaying all single posts.
*/
get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
@SeanTOSCD
SeanTOSCD / gist:4a39e1daf0c173a01fcd
Last active August 29, 2015 14:01
Quota change log
= v1.2.4 =
* added: support for EDD item quanities (EDD v2.2)
* tweaked: improved translation functions
* removed: search filter - search forms will now return results for all post types by default
= v1.2.3 =
* tweaked: replaced deprecated EDD function edd_get_cart_amount() with edd_get_cart_subtotal()
@SeanTOSCD
SeanTOSCD / gist:302b1762695f3fbacb89
Created June 12, 2014 18:34
Remove Downloads Categories / Tags widget and replace it with custom widget
<?php
/**
* replace original Categories / Tags widget with custom
*/
function replace_edd_categories_tags_widget() {
unregister_widget( 'edd_categories_tags_widget' );
register_widget( 'custom_edd_categories_tags_widget' );
}
add_action( 'widgets_init', 'replace_edd_categories_tags_widget' );
@SeanTOSCD
SeanTOSCD / gist:0727c9d45934fa9a5788
Last active August 29, 2015 14:02
Modified Checkout Cart Template for EDD (adjust subtotal/discount/tax order & adds new subtotal after discount)
<?php global $post; ?>
<table id="edd_checkout_cart" <?php if ( ! edd_is_ajax_disabled() ) { echo 'class="ajaxed"'; } ?>>
<thead>
<tr class="edd_cart_header_row">
<?php do_action( 'edd_checkout_table_header_first' ); ?>
<th class="edd_cart_item_name"><?php _e( 'Item Name', 'edd' ); ?></th>
<th class="edd_cart_item_price"><?php _e( 'Item Price', 'edd' ); ?></th>
<th class="edd_cart_actions"><?php _e( 'Actions', 'edd' ); ?></th>
<?php do_action( 'edd_checkout_table_header_last' ); ?>
</tr>
@SeanTOSCD
SeanTOSCD / fes-dashboard-tabs.php
Last active November 2, 2015 18:50
Custom FES Dashboard Tabs
<?php // DON'T COPY THIS LINE
if ( class_exists( 'EDD_Front_End_Submissions' ) ) {
function custom_vendor_dashboard_menu() {
$menu_items = array();
// Dashboard tab
$menu_items['home'] = array(
"icon" => "home",
"task" => array( 'dashboard', '' ),
@SeanTOSCD
SeanTOSCD / gist:40dc724372a03160db33
Last active September 5, 2024 01:48
EDD - Billing Details Control
<?php // DO NOT COPY THIS LINE
/**
* remove default billing details form fields
*/
function custom_edd_remove_default_fields() {
remove_action( 'edd_after_cc_fields', 'edd_default_cc_address_fields' );
}
add_action( 'init', 'custom_edd_remove_default_fields' );
@SeanTOSCD
SeanTOSCD / gist:0ff06e6d0592c5078480
Created June 24, 2014 22:30
prevent two recurring paymeny items from being added to EDD cart
<?php
function check_for_only_one_subscription_purchase_at_a_time( $item ) {
$cart_items = edd_get_cart_contents();
if ( $cart_items ) {
$a = array_values( $item );
foreach ( $a as $k => $v ) {
if ( is_array( $v ) ) {