Skip to content

Instantly share code, notes, and snippets.

View Creativenauts's full-sized avatar

Derek Creativenauts

View GitHub Profile
@Creativenauts
Creativenauts / _grid-generator.scss
Created April 13, 2017 08:49
Sass Grid Mixin Generator - Fabrik Framework - Derek Bess
// ==========================================================================
// Grid Generator Mixin
//
// Author: Derek Bess
// Requires: https://github.com/sass-mq/sass-mq
// Description: Creates a floated and flexbox grid system
//
// Container: @include make-container();
// Row: @include make-row();
// Grid: @include make-container();
@Creativenauts
Creativenauts / edd-download-grid-loop.php
Created April 2, 2016 05:22
Easy Digital Downloads - Download Grid Loop Function
function get_edd_posts($per_page, $order, $category = '', $exclude_category = '') {
$exclude_categories = explode(',', $exclude_category);
$product_args = array(
'tax_query' => array (
array(
'taxonomy' => 'download_category', // Download Category
'terms' => $exclude_categories, // Download Category Exclusions
'field' => 'slug', // Term Slug
@Creativenauts
Creativenauts / edd-parent-download-category.php
Created April 2, 2016 05:13
Easy Digital Downloads - Get Parent Category For a Download (Exclude Categories as well!)
function get_edd_parent_category() {
global $post;
$terms = wp_get_post_terms(
$post->ID,
'download_category',
array(
'parent' => 0
)
@Creativenauts
Creativenauts / edd-get-download-button.php
Created April 2, 2016 05:08
Easy Digital Downloads - Change Button Text To "Download Now" When Price = $0.00
function get_download_button() {
$price = edd_get_download_price(get_the_ID());
if ( $price == "0.00" ) {
echo '<a class="your_btn_class" href="/checkout?edd_action=add_to_cart&download_id='.get_the_ID().'">Download Now</a>';
} else {
echo '<a class="your_btn_class" href="/checkout?edd_action=add_to_cart&download_id='.get_the_ID().'">Buy Now</a>';
}
}
@Creativenauts
Creativenauts / edd-get-download-price.php
Created April 2, 2016 05:02
Easy Digital Downloads - Change Price To Free When Price = $0.00
function get_download_price() {
$price = edd_get_download_price(get_the_ID());
if ( $price == "0.00" ) {
echo 'Free';
} else {
echo '$'.$price;
}
}