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
/*
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] )
<?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
/*
* 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
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
/*
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
add_action('template_redirect', 'wtv_redirect');
function wtv_redirect($url) {
$url = $_SERVER["REQUEST_URI"];
$wines = get_terms( array('wtv_wines') );
<?php
/**
*
* @package WordPress
* @subpackage Taxonomy
*
* @uses $wpdb
*/