Skip to content

Instantly share code, notes, and snippets.

View sheabunge's full-sized avatar
😴

Shea Bunge sheabunge

😴
View GitHub Profile
@sheabunge
sheabunge / jquery-boilerplate.js
Created March 22, 2013 01:14 — forked from tommcfarlin/jquery-boilerplate.js
Demonstrates how to properly load jQuery within the context of WordPress-targeted JavaScript so that you don't have to worry about using things such as `noConflict` or creating your own reference to the jQuery function.
(function( $ ) {
"use strict";
$(function() {
// Your code here
});
@sheabunge
sheabunge / mini-admin-bar.php
Created March 26, 2013 02:58
Makes the WordPress admin bar a small button on the left and expands on hover.
<?php
/*
* Plugin Name: Mini Admin Bar
* Plugin URI:
* Description: Makes the admin bar a small button on the left and expands on hover.
* Version: 1.0
* Author: Shea Bunge
* Author URI: http://bungeshea.com
* License: MIT
*/
@sheabunge
sheabunge / allow-svg-upload.php
Last active December 15, 2015 15:09 — forked from ocean90/svg.php
Allows you to upload SVG files through the WordPress media uploader.
<?php
/**
* Plugin Name: Allow SVG Uploads
* Plugin URI: http://wordpress.stackexchange.com/q/94003/19726
* Description: Allows you to upload SVG files through the WordPress media uploader.
* Author: Shea Bunge
* Author URI: http://bungeshea.com
* Version: 1.0
*/
@sheabunge
sheabunge / only-in-feed.php
Created March 31, 2013 05:33
Adds a shortcode that will make the enclosed content either only display in the RSS feed, or hide it from the feed
<?php
/**
* Plugin Name: Only In Feed
* Description: Adds a shortcode that will make the enclosed content either only display in the RSS feed, or hide it from the feed
* Author: Shea Bunge
* Author URI: http://bungeshea.com
* Version: 1.0
*/
@sheabunge
sheabunge / vertical-centered.css
Last active December 17, 2015 03:48 — forked from LeaVerou/dabblet.css
Vertical centering with Flexbox
/**
* Vertical centering with Flexbox + margin fallback
* Lea Verou & David Storey
*/
html, body { height: 100%; }
body {
width: 100%; /* needed for FF */
margin: 0;
@sheabunge
sheabunge / activate-plugin-after-install.php
Created May 18, 2013 04:41
Adds the option to activate a plugin only on the main site to the network admin plugin install screen
<?php
/*
* Plugin Name: Activate Plugin After Install
* Description: Adds the option to activate a plugin only on the main site to the network admin plugin install screen
* Plugin URI:
* Version: 2013.05.18
* Author: Shea Bunge
* Author URI: http://bungeshea.com
* Licence: MIT
* License URI: http://opensource.org/licenses/MIT
@sheabunge
sheabunge / redirect-single-post.php
Created June 3, 2013 00:15
If the search query only returns a single post, redirect to that post.
<?php
/**
* If the search query only returns a single post, redirect to that post.
*
* @return void
* @author Paulund
* @link http://www.paulund.co.uk/redirect-search-results-return-one-post
*/
function redirect_single_post() {
<?php
/**
* Plugin Name: oEmbed in Comments
* Description: Allow oEmbeds in comment text. A fork of http://wordpress.org/plugins/oembed-in-comments/
* Version: 1.2
* Author: Evan Solomon, modified by Shea Bunge
*/
class oEmbed_Comments {
@sheabunge
sheabunge / jquery.scrolling-anchors.js
Created July 18, 2013 06:30
Make anchors smoothly scroll down the page when clicked on, instead of jumping.
$(function(){
$('a[href^="\\#"]').click(function(event){
event.preventDefault();
var full_url = this.href;
var parts = full_url.split("#");
var trgt = parts[1];
var target_offset = $("#"+trgt).offset();
var target_top = target_offset.top;
$('html, body').animate({scrollTop:target_top}, 500);
});
@sheabunge
sheabunge / remove-title-prefix.php
Last active December 20, 2015 00:39 — forked from WerdsWords/protected_title_format.php
Removes the 'Members Only' title prefix from password-protected posts.
<?php
/**
* Removes the 'Members Only' prefix from password-protected posts
*
* @see get_the_title()
*
* @param string $protected Text prefixed to the title for password-protected posts.
*
* @return string The filtered prefix text.
*/