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 / home.php
Created February 13, 2012 20:30
Genesis Custom Loop w/ Featured Image
<?php $loop_2 = new WP_Query( 'cat=1&showposts=2&orderby=date&order=DESC' ); while ($loop_2->have_posts()) : $loop_2->the_post(); ?>
<div <?php post_class(); ?>>
<div class="column-5 left">
<a href="<?php the_permalink(); ?>" /><?php the_post_thumbnail( 'thumbnail', array( 'class' => 'featured-image' ) ); ?></a>
<a href="<?php the_permalink(); ?>" /><span class="read-more">Read More</span></a>
</div>
<div class="column-6 right">
<h1 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
<?php
/**
* Adds Radio Latest News Widget.
*
* @package Radio
* @package Widgets
* @author Greg Rickaby, Justin Sternberg (@Jtsternberg), Travis Smith (@wp_smith), and StudioPress
* @license http://www.opensource.org/licenses/gpl-license.php GPL v2.0 (or later)
* @link http://www.studiopress.com/themes/genesis
*/
@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 / functions.php
Created May 30, 2012 19:20
Custom Post-Info with Google Rich Snippet support (Genesis)
remove_action( 'genesis_before_post_content', 'genesis_post_info' );
add_action( 'genesis_before_post_content', 'child_post_info' );
/**
* Custom Post-Info with Google Rich Snippet support
*
* @author Greg Rickaby
* @since 1.0.0
*/
function child_post_info() {
if ( is_page() )
@gregrickaby
gregrickaby / remove-woocommerce-styles-scripts.php
Last active April 25, 2024 09:45
Remove WooCommerce styles and scripts.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below into functions.php
/**
* Manage WooCommerce styles and scripts.
*/
function grd_woocommerce_script_cleaner() {
// Remove the generator tag
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
@gregrickaby
gregrickaby / remove-all-woocommerce-scripts-styles.php
Last active January 2, 2019 10:38
Remove ALL WooCommerce scripts and styles.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below into functions.php
/**
* Remove all WooCommerce scripts and styles! Forever!
*
* @author WP Smith
* @since 1.0.0
*/
function grd_remove_woocommerce_styles_scripts() {
@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 ?>