Skip to content

Instantly share code, notes, and snippets.

View jazzsequence's full-sized avatar
🚀
Hacking, probably.

Chris Reynolds jazzsequence

🚀
Hacking, probably.
View GitHub Profile
@jazzsequence
jazzsequence / twentyeleven-hide-stuff.php
Created February 17, 2012 13:57
hides stuff in twentyeleven theme
<?php
/*
Plugin Name: TwentyEleven Hide stuff
Plugin URI: https://gist.github.com/1853571
Description: hides stuff in twentyeleven theme
Version: 0.1
Author: Chris Reynolds
Author URI: http://museumthemes.com
License: GPL3
*/
function ap_core_do_theme_options() {
ap_core_tab_setup();
ap_core_general_settings();
ap_core_typography_settings();
ap_core_advanced_settings();
}
@jazzsequence
jazzsequence / more_human_time_diff.php
Created June 1, 2012 23:19
a better WordPress human_time_diff
<?php
$last_modified = human_time_diff( the_modified_date('U','','', false), current_time('timestamp') );
$number_of_x = preg_replace('/[^0-9]*/', '', $last_modified);
if ( strpos( $last_modified, 'min' ) || strpos( $last_modified, 'hour' ) || strpos($last_modified, 'sec' ) ) {
$wiki_date = $last_modified;
} elseif ( $number_of_x > 365 ) {
$wiki_date = __( 'a long time' );
} elseif ( $number_of_x >= 180 ) {
$wiki_date = __( 'less than a year' );
} elseif ( $number_of_x >= 60 ) {
@jazzsequence
jazzsequence / cart.php
Created September 17, 2012 22:53
cart fix
<?php echo '<span> - '; _e('OR', 'event_espresso'); echo ' - </span>'; ?>
</div>
</div>
<?php } ?>
<a href="?page_id=<?php echo $org_options['event_page_id']; ?>&regevent_action=show_shopping_cart" rel="nofollow" class="btn_event_form_submit inline-link">
<?php _e('Edit Cart', 'event_espresso'); ?>
</a>
@jazzsequence
jazzsequence / breadcrumbs.php
Created October 11, 2012 19:41
WordPress SEO Breadcrumbs
/**
* SEO Breadcrumbs
* @author Chris Reynolds
* @link http://www.quickonlinetips.com/archives/2012/02/wordpress-seo-breadcrumbs/
* Search engine optimized breadcrumbs. Original source was taken from the link above, with changes made so that it supports pages as well as posts and integrates into Twitter Bootstrap breadcrumb styles
*/
function seo_breadcrumbs() {
// this sets up some breadcrumbs for posts & pages that support Twitter Bootstrap styles
$separator = ' <span class="divider">&rsaquo;</span>';
echo '<ul xmlns:v="http://rdf.data-vocabulary.org/#" class="breadcrumb">';
@jazzsequence
jazzsequence / page-user-edit.php
Created November 23, 2012 21:32
An edit user form for Event Espresso.
<?php
/*
Template Name: Event Espresso Member Edit Page
*/
/* Get user info. */
global $current_user, $wp_roles;
get_currentuserinfo();
/* Load the registration file. */
@jazzsequence
jazzsequence / get_source.php
Last active December 14, 2015 00:39
Gets a specified url, spits it back out as just a domain
function get_source( $url ) {
$source = parse_url( $url );
$article_source = str_replace( array('www.','www1.','blogs.'), '', $source["host"]); // add whatever prefixes you want here
echo $article_source;
}
// to run this function do this:
$url = 'http://www.mydomain.com/some/crazy/path/';
function change_euro( $content ) {
$content = str_replace( 'EUR', '&euro;', $content);
return $content;
}
add_filter( 'the_content', 'my_change_ee_eur', 11 );
@jazzsequence
jazzsequence / template.php
Last active December 14, 2015 17:09
Event Espresso invoice template including surcharge/VAT support. This file should go in your /wp-content/uploads/espresso/gateways/invoice directory.
<?php
/*Custom Log Function Include*/
// require('log.php');
/*End Custom Log Function Include*/
if (isset($_SESSION['espresso_session']['id'])) {
unset($_SESSION['espresso_session']['id']);
}
define('FPDF_FONTPATH', EVENT_ESPRESSO_PLUGINFULLPATH . 'class/fpdf/font/');
require_once EVENT_ESPRESSO_PLUGINFULLPATH . 'class/fpdf/fpdf.php';
@jazzsequence
jazzsequence / comments.php
Last active December 14, 2015 20:28
Twitter-based comment system for @dropplets
<div id="comments"></div>
<script src="http://widgets.twimg.com/j/1/widget.js"></script>
<link href="http://widgets.twimg.com/j/1/widget.css" type="text/css" rel="stylesheet">
<script>
new TWTR.Widget({
type: 'search',
search: '<?php echo $post_link ?>',
id: 'comments',
loop: false,
subject: 'Comments',