Skip to content

Instantly share code, notes, and snippets.

View gregrickaby's full-sized avatar
:octocat:

Greg Rickaby gregrickaby

:octocat:
View GitHub Profile
@gregrickaby
gregrickaby / mod_jock.php
Created February 21, 2012 15:52
Jock Rotator Usage
<?php
/**
* File mod_jock.php
*
* This file builds the Jock Rotator. The Jock Rotator is nothing more than a PHP Case Statement.
* It reads your server's time/date and asks: "Is it before 10:00am? Yes? Then display this jock."
*
* @version 2.5.0
* @author Greg Rickaby <greg@gregrickaby.com>
* @copyright Copyright (c) 2012
@gregrickaby
gregrickaby / functions.php
Created March 21, 2012 19:19
Genesis Comments Form
add_filter( 'genesis_comment_form_args', 'child_comment_form' );
/**
* Change "Post Comment" button text.
*
* @author Greg Rickaby
* @since 1.0.0
*/
function child_comment_form($args) {
$args = array (
'label_submit' => __( 'Submit', 'genesis' ),
@gregrickaby
gregrickaby / functions.php
Created May 16, 2012 23:01
Thesis Child Theme
<?php
/**
* Functions.php
*
* This file handles the child theme setup and intialization.
*
* @category FMG
* @package Functions
* @author Greg Rickaby
* @since 1.0.0
@gregrickaby
gregrickaby / home.php
Created June 3, 2012 04:02 — forked from jtsternberg/home.php
Genesis Custom Loop w/ Featured Image and Odd/Even support
<?php
$odd_or_even = 'even';
$args = array(
'cat' => 1,
'posts_per_page' => 2,
'order' => 'DESC'
);
$query = new WP_Query( $args );
if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post();
@gregrickaby
gregrickaby / functions.php
Created June 5, 2012 21:45
Custom Post-Info with Google Rich Snippet support (Thesis)
add_action( 'thesis_hook_byline_item', 'custom_byline' );
/**
* Custom Post-Info with Google Rich Snippet support
*
* @author Greg Rickaby
* @since 1.0.0
*/
function custom_byline() {
if ( is_page() )
return; // don't do post-info on pages ?>
@gregrickaby
gregrickaby / functions.php
Created June 14, 2012 13:39
Add Google Authorship info to WP <head>
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 July 2, 2012 13:51
Default WordPress.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
@gregrickaby
gregrickaby / text-widget.php
Created September 10, 2012 13:41
Ads in Sidebar
<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 December 15, 2015 16:59
Add social media icons in Genesis without a plug-in
<?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 December 17, 2015 12:09
CSS for Social Media Icons (Without a Plug-In)
/* Social Media Icons
------------------------------------------------------------ */
.social-media-icons {
display: block;
height: 25px;
width: 100%;
margin: 0 0 10px;
padding: 0;
}