Skip to content

Instantly share code, notes, and snippets.

@chipbennett
chipbennett / WCTOR.copyright.2.php
Created October 29, 2011 16:12
WCTOR.copyright.2
@chipbennett
chipbennett / WCTOR.copyright.1.css
Created October 29, 2011 01:45
WCTOR.copyright.1
@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
*/
@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.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.1a.php
Created October 27, 2011 23:28
WCTOR.inlinedoc.1a
<?php
/**
*
*/
?>
@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 / 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
*/
<?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 / 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();
}