Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

<?php
/*
Plugin Name: Unplugged Mobile Theme
Plugin URI: http://www.rachelbaker.me
Description: A plugin and theme for WordPress that automatically reformats your blog's content for optimized viewing on Apple's <a href="http://www.apple.com/unplugged/">unplugged</a> and <a href="http://www.apple.com/ipodtouch/">iPod touch</a>.
Author: Rachel Baker
Version: 0.1
Author URI: http://www.rachelbaker.me
# Special thanks to Imthiaz Rafiq and the wp-pda Plugin (http://imthi.com/wp-pda/) which this plugin is derived from.
add_action( 'genesis_loop', 'cd_custom_taxonomy_archives' );
/**
* Output the taxonomy name and an associated taxonomy image
*/
function cd_custom_taxonomy_archives() {
//print the page title
the_title('<h1 class="entry-title">', '</h1>');
// Code sample modified from example on http://wordpress.mfields.org/plugins/taxonomy-images/
<?php
remove_action( 'genesis_header', 'genesis_do_header' );
add_action( 'genesis_header', 'shireman_do_custom_header' );
/**
* Modify the default header, including the #title-area div,
* along with #title and #description.
*
* Calls the genesis_site_title, and genesis_site_description.
*
@wpsmith
wpsmith / gist:4566229
Last active December 11, 2015 07:28 — forked from pdewouters/gist:4566151
<?php
add_action( 'genesis_setup', 'ssm_theme_setup', 15 );
/**
* This function runs when the them is loaded and is responsible for running
* all the action and filter hook functions that customize the theme;
*/
function ssm_theme_setup() {
/** Run some code on the genesis before hook */
<?php
/*
* Usage for a custom post type named 'movies':
* unregister_post_type( 'movies' );
*
* Usage for the built in 'post' post type:
* unregister_post_type( 'post', 'edit.php' );
*/
function unregister_post_type( $post_type, $slug = '' ){
<?php
global $wp_query;
if( 3 == $wp_query->current_post || 3 == $wp_query->current_post % 4 )
echo 'this is the fourth post';
<?php
function wps_do_pitbull_image_one() {
global $post;
wps_id_open( 'pitbull_image_one' );
$pitbull_image_one_id = genesis_get_custom_field( '_d2c_pitbull_image_one' );
echo wp_get_attachment_image(
$pitbull_image_one_id,
'smallersquare',
false,
@wpsmith
wpsmith / category.php
Last active February 24, 2019 17:13 — forked from billerickson/template-gallery.php
Custom Genesis Category Template with Pagination
<?php
/**
* Custom Category Template
*
* @package my_child_theme
* @since 1.0.0
* @author Travis Smith <t@wpsmith.net>
* @copyright Copyright (c) 2013, Travis Smith
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @link https://gist.github.com/wpsmith/5062834
<?php
add_action( 'pre_get_posts', 'smythe_no_paging' );
/**
* Remove pagination from all archive pages
*
* @author Travis Smith
* @author Bill Erickson
* @link http://www.billerickson.net/customize-the-wordpress-query/
* @param object $query data
<?php
/*
Twitter Chat Archive:
Get hashtag results from Twitter Search API (in JSON) for a weekly chat.
API takes date range via values: 'since' thru 'until' (YYYY-MM-DD).
API limits: 1 page per request, 100 results per page, 1500 total results: <7 days old.
Script below: Repeats page requests until no results found w/in date-range.
Then gathers only those results w/in specified timestamp range.
Then sort results from oldest to newest.