Skip to content

Instantly share code, notes, and snippets.

💻
<code />

Greg Rickaby gregrickaby

💻
<code />
Block or report user

Report or block gregrickaby

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
@gregrickaby
gregrickaby / functions.php
Created Jun 7, 2012
Allow HTML in WordPress Custom Menu Descriptions
View functions.php
/**
* Create HTML list of nav menu items and allow HTML tags.
* Replacement for the native menu Walker, echoing the description.
* This is the ONLY known way to display the Description field.
*
* @see http://wordpress.stackexchange.com/questions/51609/
*
*/
class Description_Walker extends Walker_Nav_Menu {
@gregrickaby
gregrickaby / functions.php
Created Jun 14, 2012
Add Google Authorship info to WP <head>
View functions.php
add_action( 'wp_head', 'child_google_authorship', 99 );
/**
* Add Google Authorship info to WP <head>
*
* @author Greg Rickaby
* @since 1.0.0
*/
function child_google_authorship() { ?>
<link rel="author" href="https://plus.google.com/XXXXXXXXXXXX/posts/">';
<?php }
@gregrickaby
gregrickaby / .htaccess
Created Jul 2, 2012
Default WordPress.htaccess
View .htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
View text-widget.php
<a href="http://gregrickaby.com/go/genesis-theme" target="_blank">
<img src="http://cdn.gregrickaby.com/affiliate/genesis_125x125.png" alt="Genesis Framework for WordPress" title="Genesis Framework for WordPress" border="0" />
</a>
<a href="http://gregrickaby.com/go/thesis-theme" target="_blank">
<img src="http://cdn.gregrickaby.com/affiliate/thesis_125x125.png" alt="Thesis Theme for WordPress" title="Thesis Theme for WordPress" border="0" />
</a>
<a href="http://gregrickaby.com/go/headway-theme" target="_blank">
<img src="http://cdn.gregrickaby.com/affiliate/headway_125x125.png" alt="Headway Theme for WordPress" title="Headway Theme for WordPress" border="0" />
@gregrickaby
gregrickaby / functions.php
Last active Nov 26, 2018
Add Google Fonts to Wordpress (the right way)
View functions.php
<?php
add_action( 'wp_enqueue_scripts', 'child_load_google_fonts' );
/**
* Enqueue Google Fonts using a function
*/
function child_load_google_fonts() {
// Setup font arguments
$query_args = array(
@gregrickaby
gregrickaby / _golden-ratio.scss
Last active Apr 23, 2019
Golden Ratio Typography for Sass
View _golden-ratio.scss
//
// Golden Ratio Typography
// --------------------------------------------------
// Golden Ratio Math
//
// Let's do some math so we can build beautiful typography and vertical rhythm.
// For any magic to happen, set the $ContentWidth variable on _variables.scss
// to match your content box width (normally this is 640px, 740px, etc...).
@gregrickaby
gregrickaby / custom.css
Last active Apr 12, 2019
CSS markup to make Tiny Tiny RSS look a bit more like Google Reader. Paste this into the Custom CSS box inside "Preferences".
View custom.css
/* Reset
------------------------------------------------------------ */
body#ttrssMain,
body#ttrssPrefs,
body#ttrssLogin,
body {
color: #000;
font-family: "Arial", sans-serif;
font-size: 100%; /* Set to default browser size, 16px */
line-height: 1.5;
@gregrickaby
gregrickaby / functions.php
Last active Dec 15, 2015
Add social media icons in Genesis without a plug-in
View functions.php
<?php
// Do NOT include the opening php tag
// pre-html5 hook add_action( 'genesis_before_post_content', 'child_social_media_icons', 5 );
add_action( 'genesis_before_entry_content', 'child_social_media_icons', 5 );
/**
* Social Media Icons without a plugin
*
* Use conditional tags to place on desired posts and pages.
*
@gregrickaby
gregrickaby / style.css
Last active Dec 17, 2015
CSS for Social Media Icons (Without a Plug-In)
View style.css
/* Social Media Icons
------------------------------------------------------------ */
.social-media-icons {
display: block;
height: 25px;
width: 100%;
margin: 0 0 10px;
padding: 0;
}
@gregrickaby
gregrickaby / .aaa-301-redirects-examples.md
Last active Nov 26, 2018
301 Redirects with .htaccess
View .aaa-301-redirects-examples.md

Below are some examples of how to deal with 301 redirects in .htaccess

Place the example code below into .htaccess

You can’t perform that action at this time.