Skip to content

Instantly share code, notes, and snippets.

View sarahmonster's full-sized avatar
🔥
Looking for new adventures

sarah ✈ semark sarahmonster

🔥
Looking for new adventures
View GitHub Profile
@sarahmonster
sarahmonster / db_local.sql
Last active December 19, 2015 03:19
A series of files to include in your git directory in order to automate WordpPress database syncs.
USE DBNAME_LOCAL;
UPDATE wp_EXT_options SET option_value="http://LOCALURL:8888" WHERE option_name="siteurl";
UPDATE wp_EXT_options SET option_value="http://LOCALURL:8888" WHERE option_name="home";
@sarahmonster
sarahmonster / gist:7148595
Created October 25, 2013 02:27
Hide WordPress admin bar
/* hide admin bar! */
add_filter('show_admin_bar', '__return_false');
@sarahmonster
sarahmonster / gist:7309014
Created November 4, 2013 20:50
Get rid of Jetpack's evil inline subscribe form CSS
$('#subscribe-field').removeAttr("style");
@sarahmonster
sarahmonster / automated-backup.sh
Last active August 29, 2015 14:04
Create WordPress backup file, save to Dropbox, then pull to development copy and replace values as required.
#!/bin/sh
export DATE=`date "+%Y-%m-%d"`
export DB_HOST=localhost
export DB_NAME=
export DB_USER=
export PASSWORD=
export DROPBOX_UPLOADER=.Dropbox-Uploader/dropbox_uploader.sh
export SCRIPTS_DIR=''
# Make sure we're in the scripts dir
@sarahmonster
sarahmonster / trac-styles.css
Created July 22, 2015 17:26
Theme trac styles
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("wpcom-themes.trac.automattic.com") {
a,
a:link,
a:visited {
color: #549dc2;
}
h3 a em,
@sarahmonster
sarahmonster / 0_reuse_code.js
Created May 26, 2016 01:48
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@sarahmonster
sarahmonster / add-span-to-count.php
Created August 22, 2016 13:22
Adds a span around post counts in category archives widget and general archives widgets. This allows for easy styling of the count—for instance, using leading dots. (The SCSS file adds leading dots.)
/**
* Filter the categories archive widget to add a span around post count
*/
function smittenkitchen_cat_count_span( $links ) {
$links = str_replace( '</a> (', '</a><span class="post-count">(', $links );
$links = str_replace( ')', ')</span>', $links );
return $links;
}
add_filter( 'wp_list_categories', 'smittenkitchen_cat_count_span' );
@sarahmonster
sarahmonster / typekit.php
Created August 22, 2016 13:25
Enqueue Typekit fonts for better local development.
/**
* Enqueue Typekit fonts for local development.
*
* @action wp_head
* @return string
*/
function themeslug_local_fonts() {
if ( 'http://themeslug.dev' === site_url() ):
$kit = '#######';
?>
@sarahmonster
sarahmonster / display-sharing-links.php
Created August 25, 2016 22:42
Remove (and optionally re-add) sharing links on WordPress.com
@sarahmonster
sarahmonster / .gitignore
Last active November 8, 2016 17:25
Gulp setup for WordPress themes
*.map
node_modules/*