Skip to content

Instantly share code, notes, and snippets.

View pippinsplugins's full-sized avatar

Pippin Williamson pippinsplugins

View GitHub Profile
@pippinsplugins
pippinsplugins / gist:3505086
Created August 28, 2012 22:53
Remove the restriction for one-time-only-discounts
function pw_edd_disable_single_use( $return, $code, $email ) {
return false;
}
add_filter( 'edd_is_discount_used', 'pw_edd_disable_single_use', 10, 3 );
function pw_remove_downloads_from_search( $query ) {
if( $query->is_search() && $query->is_main_query() ) {
$query->set('post_type', array( 'page', 'post'' ) ); // add any other post types you want to include
}
}
add_action( 'pre_get_posts', 'pw_remove_downloads_from_search' );
function pw_edd_change_download_cap( $args ) {
$args['capability_type'] = 'page';
return $args;
}
add_filter( 'edd_download_post_type_args', 'pw_edd_change_download_cap' );
<?php
#
# rt-theme loop
#
global $args,$content_width,$paged;
add_filter('excerpt_more', 'no_excerpt_more');
//varialbles
$video_width = ($content_width =="960") ? 940 : 606;
function jc_paged_posts_columns() {
echo '<div id="paged-columns">';
global $post;
$numposts = 11;
$args = array( 'numberposts' => $numposts, 'offset' => 10 );
$column1 = get_posts( $args );
echo '<ul class="column-list">';
echo '<li class="column-heading">Page 2</li><ol>';
foreach ( $column1 as $post ) : setup_postdata($post); ?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php
/*
Plugin Name: Newton Police PHP to Access
Description: Inserts form data from the website into the access databases
Author: Pippin Williamson
Version: 1.0
*/
function test_db() {
/*
* Gets the excerpt of a specific post ID or object
* @param - $post - object/int - the ID or object of the post to get the excerpt of
* @param - $length - int - the length of the excerpt in words
* @param - $tags - string - the allowed HTML tags. These will not be stripped out
* @param - $extra - string - text to append to the end of the excerpt
*/
function rcp_excerpt_by_id($post, $length = 50, $tags = '<a><em><strong><blockquote><ul><ol><li><p>', $extra = ' . . .') {
if(is_int($post)) {
<?php
/**
* @package WordPress
* @subpackage Default_Theme
*/
get_header(); ?>
<div class="container" id="main-content">
@pippinsplugins
pippinsplugins / single-forum.php
Created September 5, 2012 16:35
Doesn't work
<?php
/**
* @package WordPress
* @subpackage Default_Theme
*/
get_header(); ?>
<div class="container" id="main-content">
@pippinsplugins
pippinsplugins / single-forum.php
Created September 5, 2012 16:35
Doesn't work
<?php
/**
* @package WordPress
* @subpackage Default_Theme
*/
get_header(); ?>
<div class="container" id="main-content">