Skip to content

Instantly share code, notes, and snippets.

View anthonycole's full-sized avatar
🏠
Working from home

Anthony Cole anthonycole

🏠
Working from home
View GitHub Profile
<?php
/**
*
* @package WordPress
* @subpackage Taxonomy
*
* @uses $wpdb
*/
<?php
add_action('template_redirect', 'wtv_redirect');
function wtv_redirect($url) {
$url = $_SERVER["REQUEST_URI"];
$wines = get_terms( array('wtv_wines') );
<?php
/*
Plugin Name: Taxononmy Navigation Dropdown
Version: 0.1
Plugin URI: http://anthonycole.me/wordpress/taxonomy-nav-dropdown/
Description: This plugin allows you to add a simple widget linking all of your taxonomies together.
Author: Anthony Cole
Author URI: http://anthonycole.me/
Copyright 2010 Anthony Cole ( email: [email protected] )
<?php
function woo_ecommerce_meta_save( $post_id ){
// Verify this came from the our screen and with proper authorization
if ( !wp_verify_nonce( $_POST['woo_ecomm_noncename'], plugin_basename('woo_ecomm_product') )) {
return $post_id;
}
// Verify if this is an auto save routine.
if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )
return $post_id;
<?php
/*
* Make the documentation here better, but this is a function to get all of the terms
*/
function get_topics( $args ) {
return get_terms( array('topic'), $args );
<?php
query_posts( array( 'post_type' => 'video', 'posts_per_page' => 2, 'paged' => get_query_var( 'paged' ) ) );
while( have_posts() ) : the_post();
?>
<div class="widget">
<h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
<a href="<?php the_permalink(); ?>">
<?php
if ( has_post_thumbnail() )
<?php
/*
Plugin Name: WPEC Product Search History
Version: 1.0
Plugin URI: http://anthonycole.me/wp-search-history/
Description: Allows a user to see products that match results from their search history
Author: Anthony Cole
Author URI: http://anthonycole.me/
Copyright 2011 (email: [email protected] )
<?php
/*
Plugin Name: WPEC Product Search History
Version: 1.0
Plugin URI: http://anthonycole.me/wp-search-history/
Description: Allows a user to see products that match results from their search history
Author: Anthony Cole
Author URI: http://anthonycole.me/
Copyright 2011 (email: [email protected] )
@anthonycole
anthonycole / gist:1325539
Created October 30, 2011 05:19
WordCamp Gold Coast Sample Plugin
<?php
/**
* Appends content to WordPress content
*
* @return var $new_content
* @author Anthony Cole
**/
function wcgold_modify_content( $content ) {
$string = ' and WordCamp Gold Coast is Awesome!';
@anthonycole
anthonycole / acf-georss.php
Created September 3, 2012 07:18 — forked from anonymous/acf-georss.php
GeoRSS Support for the location extension of Advanced Custom Fields. Work in progress.
<?php
/*
Plugin Name: GeoRSS ACF Extension
Author: Anthony Cole
Author URI: http://anthonycole.me/
Description: Extends ACF Locations extension to allow plotting multiple locations on a map with GeoRSS
Version: 0.5
*/
class GeoRSS_Map {