Skip to content

Instantly share code, notes, and snippets.

Pat Ramsey ramseyp

Block or report user

Report or block ramseyp

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ramseyp / custom-jetpack-share.php
Last active Aug 29, 2015
Empty the Jetpack Sharing Label input; localize a script to feed it a custom value, wrapped in a p tag.
View custom-jetpack-share.php
* If the Jetpack Sharing label setting has a value, remove it.
* If that field is empty, Jetpack Sharing will not output a set of H3 tags with the label.
function sharing_label_clear() {
if ( class_exists( 'Sharing_Service' ) ) :
ramseyp / if_exists.php
Last active Aug 29, 2015
Check to see if something exists before you call some function / class / method in your WordPress functions.php
View if_exists.php
if ( function_exists( 'function_name' ) ) {
//... do something ...
if ( class_exists( 'Class_Name' ) ) {
View mangled-htaccess
# # BEGIN WordPres<I<IfModule mod_rewrite.cReRewriteEngine OReRewriteBase ReRewriteRule ^index\.php$ - [LReRewriteCond %{REQUEST_FILENAME} !-ReRewriteCond %{REQUEST_FILENAME} !-RewriteRule . /index.php [L]
# END WordPress
View QandD.css
@media only screen and (max-width: 1139px) {
.site-header .widget-area {
width: 600px;
.genesis-nav-menu a {
padding: 40px 7px 20px;
ramseyp / rsync command with multiple exclusions
Created May 12, 2014
rsync while excluding multiple directories
View rsync command with multiple exclusions
rsync -arv --exclude="*.git" --exclude=".svn" source/ /destination/
ramseyp / tmpl_child-pages.php
Created Aug 20, 2014
Genesis child theme custom page template that shows child pages of the current page. Heavily based on:
View tmpl_child-pages.php
Template Name: Custom Loop
remove_action( 'genesis_loop','genesis_do_loop' );
add_action( 'genesis_loop','my_custom_loop' );
function my_custom_loop() {
View test_post_meta.php
remove_action('genesis_loop', 'genesis_do_loop');
add_action('genesis_loop', 'custom_loop');
function custom_loop() {
echo '<h1 class="entry-title" itemprop="headline">'.get_the_title().'</h1>';
echo '<div class="clear"></div>';
echo '<div class="singlebio">';
ramseyp / expire_posts
Created Nov 3, 2011
Set Posts older than 3 years from current date to draft status
View expire_posts
* Set Posts older than 3 years from current date to draft status
* @link
* @param string
* @return string
add_action( 'init', 's25_mass_expire' );
function s25_mass_expire(){
global $wpdb;
ramseyp / gist:1336624
Created Nov 3, 2011
Change default settings for the Genesis Primary Sidebar
View gist:1336624
* Change default settings for the Genesis Primary Sidebar
* @link
* @param string
* @return string
//Gets rid of the default Primary Sidebar
unregister_sidebar( 'sidebar' );
ramseyp / gist:1337144
Created Nov 3, 2011
Modify User Profile to include an active checkbox
View gist:1337144
//Extra Author Profile Meta
add_action( 'show_user_profile', 'my_show_extra_profile_fields' );
add_action( 'edit_user_profile', 'my_show_extra_profile_fields' );
function my_show_extra_profile_fields( $user ) { ?>
<h3>Is this an active author?</h3>
<table class="form-table">
You can’t perform that action at this time.