Skip to content

Instantly share code, notes, and snippets.

View stephanieleary's full-sized avatar

Stephanie Leary stephanieleary

View GitHub Profile
@stephanieleary
stephanieleary / shortlink-all-the-things.php
Created November 5, 2012 22:35
Shortlink All the Things
@stephanieleary
stephanieleary / wp_private_page_filters.php
Last active March 7, 2018 12:41
Private page filters for WordPress. Related to ticket #8592.
<?php
/*
Plugin Name: Unpublished Hierarchies
Description: A tiny plugin to allow draft, private, scheduled, and password-protected pages to be selected as parents.
Author: Stephanie Leary
Version: 1.0
Author URI: http://stephanieleary.com
License: GPL2
*/
@stephanieleary
stephanieleary / gist:7735574
Created December 1, 2013 15:52
space out @Ghostfinder's books
#post-1110 .wp-caption.alignleft { margin-right: 68px; }
#post-1110 .wp-caption.alignleft:nth-child(3n) { margin-right: 0; }
@stephanieleary
stephanieleary / gist:8718496
Last active August 29, 2015 13:55
Achievements 2.4 plugin for LetterMo
<?
/*
Plugin Name: LetterMo Post Types
Plugin URI: http://stephanieleary.com/
Version: 1.5
Author: Stephanie Leary
Author URI: http://stephanieleary.com/
Description: Setting up the post types and achievements for Month of Letters.
License: GPL2
*/
@stephanieleary
stephanieleary / gist:8718584
Last active August 29, 2015 13:55
Achievements 3.5 plugin for LetterMo
<?php
/*
Plugin Name: LetterMo Post Types
Plugin URI: http://stephanieleary.com/
Version: 1.6
Author: Stephanie Leary
Author URI: http://stephanieleary.com/
Description: Setting up the post types and achievements for Month of Letters.
License: GPL2
*/
@stephanieleary
stephanieleary / showmimes.php
Last active August 29, 2015 14:14
Add filters for PDF, Word, and Excel files in the media library
<?php
/*
Plugin Name: Show MIMEs
Description: A tiny plugin to add more file type filters in the media library screens.
Author: Stephanie Leary
Version: 1.1
Author URI: http://sillybean.net/
*/
@stephanieleary
stephanieleary / category.php
Last active August 29, 2015 14:15
category.php or taxonomy.php for deep hierarchies
<?php get_header(); ?>
<div id="container">
<div id="content" role="main">
<?php the_archive_title( '<h1 class="page-title">', '</h1>' ); ?>
<?php the_archive_description( '<div class="term-description">', '</div>' ); ?>
<?php
// Find out if this term has child terms
$object = get_queried_object();
$termchildren = get_term_children( $object->term_id, $object->taxonomy );
var words = $('dd.words').text();
var length = 'under1';
if ( words > 999 ) {
var kwords = Math.round(words / 1000);
if (kwords >= 100)
length = '100';
else if (kwords >= 50)
length = '50to100';
(function(){function callback(){(function($){var jQuery=$;
var words = $('dd.words').text();
var length = 'under1';
if ( words > 999 ) {
var kwords = Math.round(words / 1000);
if (kwords >= 100)
length = '100';
<?php
// * Search & Filter Pro filters
// Limit taxonomy term dropdowns to terms associated with the form's specified post type(s)
// cf https://gist.github.com/rmorse/7b59b45a14b1ca179868#file-sf-pro-filter-input-object-php
function example_filter_input_object( $input_object, $sfid ) {
if ( ( !in_array( $input_object['name'], array( '_sft_one', '_sft_two', '_sft_three' ) ) ) )
return $input_object;
// make sure the options variable actually exists (it's only available to certain field types)