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 / style.css
Created March 14, 2013 16:17
Custom CSS for chrisreynolds.io -- details here: http://s3q.us/ne
/* custom css */
@import url(../style.css); /* call the parent css */
body {
background: #282a36; /* Old browsers */
background: -moz-linear-gradient(top, #282a36 25%, #282b3d 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(25%,#282a36), color-stop(100%,#282b3d)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #282a36 25%,#282b3d 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #282a36 25%,#282b3d 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #282a36 25%,#282b3d 100%); /* IE10+ */
@jazzsequence
jazzsequence / event_list_display.php
Created March 20, 2013 20:10
change register link to "register for [this event]"
// change this:
<a class="a_register_link ui-button ui-button-big ui-priority-primary ui-state-default ui-state-hover ui-state-focus ui-corner-all" id="a_register_link-<?php echo $event_id ?>" href="<?php echo $registration_url; ?>" title="<?php echo stripslashes_deep($event_name) ?>"><?php _e('Register', 'event_espresso'); ?></a>
// to this:
<a class="a_register_link ui-button ui-button-big ui-priority-primary ui-state-default ui-state-hover ui-state-focus ui-corner-all" id="a_register_link-<?php echo $event_id ?>" href="<?php echo $registration_url; ?>" title="<?php echo stripslashes_deep($event_name) ?>"><?php _e('Register for', 'event_espresso'); echo stripslashes_deep($event_name); ?></a>
@jazzsequence
jazzsequence / taxonomy-links.php
Last active September 4, 2018 11:14
Get taxonomy links in WordPress for a custom post type and custom taxonomy, similar to get_the_category_list() or get_the_term_list() but is a bit smarter about separators.
@jazzsequence
jazzsequence / skematik_ee_hacks.php
Created May 20, 2013 17:03
This gist will remove the my profile link in the Skematik theme user dropdown menu and replace it with edit profile and my events page links intended for Event Espresso [ESPRESSO_EDIT_PROFILE] and [ESPRESSO_MY_EVENTS] pages. Can be added to a child theme's functions.php file or built into a plugin.
function skematik_hack_remove_profile() {
/* remove the skematik profile link */
remove_action( 'skematik_nav_profile_dropdown', 'skematik_account_profile_link');
}
add_action( 'init', 'skematik_hack_remove_profile' );
function skematik_hack_ee_profile_dropdown() {
$my_events = '<li><a href="' . home_url() . '/my-events/">' . __( 'My Events' ) . '</a></li>';
$edit_profile = '<li><a href="' . home_url() . '/my-profile/">' . __( 'My Profile' ) . '</a></li>';
echo $my_events . $edit_profile;
@jazzsequence
jazzsequence / ps-demo-plugin.php
Created May 24, 2013 23:06
Demonstration plugin for my Introduction to WordPress Plugin Development course for Pluralsight. Download the full source here: http://cl.ly/3u153a2N1v32
<?php
/*
Plugin Name: Pluralsight plugin development demo
Description: This is a demonstration plugin for the Introduction to WordPress Plugin Development course on Pluralsight.
Author: Chris Reynolds
Version: 1.0
*/
function ps_plugindev_options_page() {
?>
@jazzsequence
jazzsequence / updated-blog-metrics-i18n.php
Last active December 19, 2015 19:09
Updated Blog Metrics plugin internationalization demonstration, before and after. updated-blog-metrics.php is the BEFORE, updated-blog-metrics-i18n.php is the AFTER.
<?php
/*
Plugin Name: Updated Blog Metrics
Version: 1.3
Plugin URI: https://github.com/jazzsequence/updated-blog-metrics
Description: Based on Joost de Valk's <a href="http://yoast.com/wordpress/blog-metrics/" target="_blank">Blog Metrics</a> plugin, provides author metrics over the past year rather than just the past 30 days.
Author: jazzsequence
Author URI: http://www.arcanepalette.com/
Copyright 2007-2009 Chris Reynolds (email : chris@jazzsequence.com)
add_action( 'add_meta_boxes', 'my_remove_meta_boxes', 0 );
function my_remove_meta_boxes(){
global $wp_meta_boxes;
unset( $wp_meta_boxes['post']['side']['core']['tagsdiv-post_tag'] );
add_meta_box( 'tagsdiv-post_tag', 'Example title', 'post_tags_meta_box', 'post', 'normal', 'core', array( 'taxonomy' => 'post_tag' ));
//print '<pre>';print_r( $wp_meta_boxes['post'] );print '<pre>';
}
@jazzsequence
jazzsequence / admin-style.css
Last active December 21, 2015 07:58
Using the Genericons icon font for WordPress dashboard icons
#menu-posts-book-review .wp-menu-image {
background: none!important;
}
#menu-posts-book-review .wp-menu-image:before {
font-family: 'Genericons'!important; /* this assumes you've loaded Genericons in your admin */
content: '\f444'; /* replace this with your icon */
font-size: 20px;
position: relative;
left: 5px; /* positions the icon */
top: 4px; /* positions the icon */
@jazzsequence
jazzsequence / has_term.php
Created August 21, 2013 18:20
Simple check if current post has any terms with the given taxonomy. Must be used within the Loop.
if ( has_term('', 'my-tax') ) {
// do stuff with 'my-tax' posts
// http://codex.wordpress.org/Function_Reference/has_term
}
@jazzsequence
jazzsequence / pluralsight_module.sublime-snippet
Last active December 23, 2015 22:29
SublimeText 2 snippet for creating Pluralsight module .meta files -- copy to your /Packages/User folder
<snippet>
<content><![CDATA[
<?xml version="1.0" encoding="utf-8"?>
<module xmlns="http://pluralsight.com/sapphire/module/2007/11">
<author>${1:author-name}</author>
<title>${2:module-title}</title>
<description>${3:module-description}</description>
<clips>
<clip href="${4:course-slug}-${5:module-number}${6:module-clip}.wmv" title="${11:clip $6 title}" />
<clip href="${4:course-slug}-${5:module-number}${7:module-clip}.wmv" title="${12:clip $7 title}" />