Skip to content

Instantly share code, notes, and snippets.

@chipbennett
chipbennett / oenology_get_github_api_data
Created July 23, 2011 03:52
Function to return tabulated GitHub API commits and issues data for use in WordPress Theme settings pages
/**
* Get GitHub API Data
*
* Uses the GitHub API (v3) to get information
* regarding open or closed issues (bug reports)
* or commits, then outputs them in a table.
*
* Derived from code originally developed by
* Michael Fields (@_mfields):
* @link https://gist.github.com/1061846 Simple Github commit API shortcode for WordPress
@chipbennett
chipbennett / wptinymcecustomconfig
Created August 6, 2011 14:25
Customize WordPress TinyMCE Configuration
/*****************************************************************************************
* Customize TinyMCE Configuration
*******************************************************************************************/
// http://tinymce.moxiecode.com/wiki.php/Configuration
function nhcc_tinymce_config( $init ) {
// Change code cleanup/content filtering config
// Don't remove line breaks
@chipbennett
chipbennett / gist:1189257
Created September 2, 2011 17:40
Example hook callback with contextual conditionals
/**
* Hook into hypothetical action hook
*/
function themeslug_after_post() {
// Let's only do something on
// single blog posts
if ( is_single() ) {
// output a hypothetical related posts function
related_posts();
}
<?php
// First, backup the default $postdata
$backup = $post;
// Now, override the default
$tags = wp_get_post_tags($post->ID);
// Now, open the if ( $tags ) statement
if ($tags) {
$tag_ids = array();
@chipbennett
chipbennett / skype_toolbar_meta.php
Created October 19, 2011 17:41
Stop Skype from hijacking phone numbers
<?php
/**
* Stop Skype from hijacking phone numbers
*
* Adds a META tag to the HTML document head, that
* prevents Skype from hijacking/over-writing phone
* numbers displayed in the Theme.
*
* @link http://www.wpbeginner.com/wp-tutorials/how-to-fix-skype-overwriting-phone-numbers-in-wordpress-themes/ H/T WPBeginner
*/
@chipbennett
chipbennett / WCTOR.inlinedoc.1.php
Created October 27, 2011 22:36
WCTOR.inlinedoc.1
<?php get_header( oenology_get_context() ); ?>
<!-- Begin Main (div#main) -->
<div id="main">
<?php get_template_part( 'loop', oenology_get_context() ); ?>
</div>
<!-- End Main (div#main) -->
<?php
if ( 'one-column' != $oenology_options['post_index_layout'] ) {
@chipbennett
chipbennett / WCTOR.inlinedoc.1a.php
Created October 27, 2011 23:28
WCTOR.inlinedoc.1a
<?php
/**
*
*/
?>
@chipbennett
chipbennett / WCTOR.inlinedoc.2.php
Created October 27, 2011 23:40
WCTOR.inlinedoc.2
<?php
/**
* Master/Default template file
*
* This file is the master/default template file, used when no other file matches in
* the {@link http://codex.wordpress.org/Template_Hierarchy Template Hierarchy}.
*
* @uses oenology_get_context() Defined in /functions/custom.php
*
* @link http://codex.wordpress.org/Function_Reference/get_header get_header()
@chipbennett
chipbennett / WCTOR.inlinedoc.1b.php
Created October 27, 2011 23:49
WCTOR.inlinedoc.1b
<?php
/**
* Short Description
*
* Long description
*
* @package Theme Name
* @copyright Copyright (c) YYYY, Your Name
* @license http://www.example.com License Name
*
@chipbennett
chipbennett / WCTOR.inlinedoc.2a.php
Created October 28, 2011 01:35
WCTOR.inlinedoc.2a
<?php
/**
* Short Description
*
* Long description
*
* @param datatype $param (required/optional) Description
*
* @return datatype Description
*/