Skip to content

Instantly share code, notes, and snippets.

View brashrebel's full-sized avatar

Kyle Maurer brashrebel

View GitHub Profile
@brashrebel
brashrebel / edd_grid.php
Last active November 15, 2016 12:50 — forked from pippinsplugins/edd_grid.php
sample Easy Digital Downloads Product Grid with Pagination
<?php get_header(); ?>
<div id="main-content" class="row store-template">
<div class="content clearfix">
<?php
$current_page = get_query_var('paged');
$per_page = get_option('posts_per_page');
$offset = $current_page > 0 ? $per_page * ($current_page-1) : 0;
$product_args = array(
'post_type' => 'download',
@brashrebel
brashrebel / loop.php
Created July 17, 2015 17:50
The Loop Example
<?php
// CUSTOM QUERY
// Build the arguments for a query
$args = array(
'author' => 'kyle',
'posts_per_page' => 2,
'nopaging' => true,
);
// Create a query object
$dis_query = new WP_Query( 'posts_per_page' );
@brashrebel
brashrebel / zeeshan
Created July 14, 2015 11:24
Purchase Link Manipulation
add_action( 'edd_format_amount_decimals', 'kjm_format_decimals' );
function kjm_format_decimals() {
return 0;
}
add_filter( 'edd_purchase_link_args', 'kjm_adjust_purchase_link_text' );
function kjm_adjust_purchase_link_text( $args ) {
$download = new EDD_Download( $args['download_id'] );
@brashrebel
brashrebel / rbm-schedule.php
Created May 28, 2015 21:43
My example of using a Google sheet
<?php
/*
Plugin Name: RBM Schedule
Plugin URI: http://realbigplugins.com
Description: Creates a way for our schedule to be quickly and easily referenced.
Version: 0.1
Author: Kyle Maurer
Author URI: http://realbigmarketing.com
License: GPL2
<?php
// CUSTOM BOOK QUERY
$post_id = get_the_ID();
$args = array(
//Type & Status Parameters
'post_type' => 'accomplishment',
'post_status' => 'publish',