Skip to content

Instantly share code, notes, and snippets.

View ryandonsullivan's full-sized avatar

Ryan Sullivan ryandonsullivan

View GitHub Profile
function wpsc_tutorial_icons() {
global $post_type;
?>
<style>
<?php if (($_GET['post_type'] == 'tutorial') || ($post_type == 'tutorial')) : ?>
#icon-edit { background:transparent; background-image: url('<?php echo plugins_url('images/tutorial.png', __FILE__) ?>') no-repeat !important; }
<?php endif; ?>
#adminmenu #menu-posts-tutorial div.wp-menu-image{background:transparent; background-image: url('<?php echo plugins_url('images/tutorial.png', __FILE__) ?>') no-repeat !important;}
#adminmenu #menu-posts-tutorial:hover div.wp-menu-image,#adminmenu #menu-posts-tutorial.wp-has-current-submenu div.wp-menu-image{background:transparent; background-image: url('<?php echo plugins_url('images/tutorial.png', __FILE__) ?>') no-repeat !important;}
</style>
@ryandonsullivan
ryandonsullivan / so_jacked_up.php
Last active December 28, 2015 06:58
WHY? WHYYYY???
<?php
//don't use (deregister) WP's jQuery version
wp_deregister_script( 'jquery' );
//Use jQuery from Google Code
wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js');
//Include one of my custom javascript files

Keybase proof

I hereby claim:

  • I am ryandonsullivan on github.
  • I am ryandonsullivan (https://keybase.io/ryandonsullivan) on keybase.
  • I have a public key whose fingerprint is 0D04 1D1F 65ED A1E9 D39E A53F 43E1 E10B B252 6463

To claim this, I am signing this object:

@ryandonsullivan
ryandonsullivan / 0_reuse_code.js
Last active August 29, 2015 14:07
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
<?php
/*
Plugin Name: Genesis Simple Logo
Description: Lets you easily add a logo to your Genesis website using the WordPress customizer.
Version: 1.0.8.1
License: GPL version 2 or any later version
Plugin URI: http://flagshipwp.com/plugins/genesis-simple-logo/
Git URI: https://github.com/wpbacon/genesis-simple-logo
Author: Flagship
Author URI: http://flagshipwp.com/
@ryandonsullivan
ryandonsullivan / fixlinks.php
Last active November 16, 2017 08:48
Fix Blogger post permalinks after import into WordPress
@ryandonsullivan
ryandonsullivan / .htaccess
Created October 28, 2015 18:44
This redirects all Blogger RSS feeds to their corresponding WordPress RSS feeds when added to .htaccess
#Author: WP Site Care
#Link: http://www.wpsitecare.com/import-blogger-to-wordpress/
#ATOM Feeds
RewriteRule atom.xml feed/atom/ [L,R=301]
RewriteRule feeds/posts/default feed/atom/ [L,R=301]
#RSS FEEDS
RewriteRule feeds/posts/default?alt=rss feed/ [L,R=301]
RewriteRule rss.xml feed/ [L,R=301]
#Comments Feed
@ryandonsullivan
ryandonsullivan / .htaccess
Created October 28, 2015 18:46
This redirects all label archive URLs at Blogger to corresopnding WordPress category archives
#Author: WP Site Care
#Link: http://www.wpsitecare.com/import-blogger-to-wordpress/
#Redirect archives
RewriteRule ^([0-9]{4})_([0-9]{1,2})_([0-9]{1,2})_archive.html$ $1/$2/ [L,R=301]
#Redirect labels/categories
RewriteRule ^search/label/(.*)$ category/$1/ [L,R=301]
<?php
/**
* The base configuration for WordPress
*
* The wp-config.php creation script uses this file during the
* installation. You don't have to use the web site, you can
* copy this file to "wp-config.php" and fill in the values.
*
* This file contains the following configurations:
*
@ryandonsullivan
ryandonsullivan / stop-rss-feed-crawl
Created March 22, 2023 14:21
Stop web crawlers from spending crawl budget on RSS feeds, without interrupting RSS feed functionality.
# Block Feed and Comments
User-agent: *
Disallow: /feed/
Disallow: /feed/$
Disallow: /comments/feed
Disallow: /trackback/
Disallow: */?author=*
Disallow: */author/*
Disallow: /author*
Disallow: /author/