Skip to content

Instantly share code, notes, and snippets.


Kristen Symonds kristarella

View GitHub Profile
mfields / theme-options.php
Created Jan 31, 2013
Sample theme options page for WordPress Themes.
View theme-options.php
* _s Theme Options
* @package _s
* @since _s 1.0
* Register the form setting for our _s_options array.
mattonomics / gist:4079235
Created Nov 15, 2012
New html method parameter
View gist:4079235
Name: Box Name
Author: Author Name
Description: A good description of this box
Version: Box version
Class: box_class_with_underscore
class box_class_with_underscore extends thesis_box {
webercoder / wp-author-import-auto-select.js
Created Jun 4, 2012
Auto-select authors for posts during WordPress import. They must already be assigned to the project. Enable jQuery in a plugin or functions.php, and paste this in the browser console.
View wp-author-import-auto-select.js
$('#authors li').each(function(key, value) {
var name = $(this).children('strong').first().html();
var re = /\s\([^\)]+\)/gi;
name = name.replace(re, '');
if ($(this).html() == name) {
console.log('Comparing ' + $(this).html() + ' to ' + name + ".\n");
$(this).attr('selected', 'selected');
jonathanmoore / gist:2640302
Created May 8, 2012
Get the share counts from various APIs
View gist:2640302

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.


billerickson / gist:1888923
Created Feb 23, 2012
Popular Posts Widget
View gist:1888923
* Popular Posts Widget
* Displays posts in last X days, sorted by most comments (proxy for popularity)
* @package Core Functionality
* @author Bill Erickson <>
* @copyright Copyright (c) 2011, Bill Erickson
* @license GNU Public License
You can’t perform that action at this time.