Skip to content

Instantly share code, notes, and snippets.

View shawnsandy's full-sized avatar

Shawn Sandy shawnsandy

View GitHub Profile
@shawnsandy
shawnsandy / zurb-examples
Created October 21, 2011 20:30
Zurb examples
<!-- The Basics -->
<div class="container">
<div class="row">
<div class="eight columns">
Eight columns
</div>
<div class="four columns">
Four columns
</div>
@shawnsandy
shawnsandy / be_gallery_functions.php
Created November 27, 2011 18:25
gallery metabox support
@shawnsandy
shawnsandy / list-terms.php
Created November 27, 2011 21:00
Get a list of taxonomies (term) by name
<ul>
<?php
$terms = get_the_terms($post->ID, 'design');
if ($terms && !is_wp_error($terms)) :
$draught_links = array();
foreach ($terms as $term) {
echo "<li><strong>{$term->name}</strong> - {$term->description}</li>";
@shawnsandy
shawnsandy / hoverizer-sample.php
Created November 28, 2011 22:07
Adds jquery hoverizr to wordpress
<?php
function theme_scripts(){
wp_register_script('hoverizer', get_template_directory_uri() . '/library/hoverizer/jquery.hoverizr.min.js', array('jquery'));
wp_enqueue_script('hoverizer');
}
function cwp_theme_footer(){
?>
<script type="text/javascript">
jQuery.noConflict(true);
@shawnsandy
shawnsandy / Custom Nav menu
Created December 25, 2011 17:02
Wordpress Custom nav menu
class description_walker extends Walker_Nav_Menu {
//http://www.kriesi.at/archives/improve-your-wordpress-navigation-menu-output
function start_el(&$output, $item, $depth, $args) {
global $wp_query;
$indent = ( $depth ) ? str_repeat("\t", $depth) : '';
$class_names = $value = '';
@shawnsandy
shawnsandy / metabox
Created January 4, 2012 15:49
meta-box
<?php /**
* *****************************************************************************
* Add Metaboxes
* *****************************************************************************
*/
//add_action( 'add_meta_boxes', 'cwpt_custom_metaboxes' );
function cwpt_custom_metaboxes(){
add_meta_box('cwpt_preview', 'Site Preview', 'cwpt_preview_box', 'cwp_custom_options', 'normal', 'high');
@shawnsandy
shawnsandy / theme-demo-bar.php
Created January 8, 2012 16:35
WP theme demo bar fixed to work with WP3.3 in debug mode
<?php
/* admin menu */
add_action('admin_menu', 'TDB_menu');
//wp_theme_demo_bar.php changed line 542 to userlevel 8 > manage_options **********************************
function TDB_menu() {
global $zv_wptdb_plugin_name;
$pluginpage = add_options_page($zv_wptdb_plugin_name, 'WP Theme Demo Bar', 'manage_options', __FILE__, 'TDB_options');
add_action('admin_head-'.$pluginpage, 'wpthemedemobar_admin_head');
}
@shawnsandy
shawnsandy / quick_jump.php
Created February 12, 2012 20:50
Admin Quick Jump Edit
<?php
$jck_posts_recent = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE $wpdb->posts.post_parent = 0 AND $wpdb->posts.post_type = '$posttype' AND $wpdb->posts.post_status = 'publish' ORDER BY ID DESC LIMIT 10");
if ($jck_posts_recent) {
$content .= "<optgroup label='Recently' style='color: #ccc; padding: 5px;'>";
foreach ($jck_posts_recent as $jck_post) {
$selected = ($jck_post->ID == $post->ID) ? "style='color: #333;padding:3px 0 3px 6px;border-bottom:1px solid #eee;font-weight:bold;' disabled='disabled' selected='selected'" : '';
<?php
/**
* @package JCK_Quick_Jump Modified
* @version 1.3
*/
/*
Plugin Name: Admin Quick Jump Modified
<?php
/*
Plugin Name: custom-adminbar-post-menu
Plugin URI: http://mysite.com
Description: Adds menu list of post by status to your admin bar, quickly jump to and and from post easily from the admin menu.
Author: me
Author URI: http://mysite.com
Version: 0.1