Skip to content

Instantly share code, notes, and snippets.

Chris Cree ChrisCree

Block or report user

Report or block ChrisCree

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
ChrisCree / page_rotator2.php
Created Feb 8, 2014
Example of a page template for the Genesis theme framework that adds a widget area after the header.
View page_rotator2.php
* Template Name: Rotator 2
add_action( 'genesis_after_header', 'wsm_add_rotator2' );
function wsm_add_rotator2() {
ChrisCree / functions.php
Created Feb 15, 2014
To enable the old Link Manager in newer WordPress installations add this filter to your theme's functions.php file.
View functions.php
// Do not copy opening PHP tag
// Enable WordPress Link Manager
add_filter( 'pre_option_link_manager_enabled', '__return_true' );
ChrisCree / hide-select-down-arrow.css
Created Feb 15, 2014
Here's some CSS to display a down arrow image instead of the default select tab in the various browsers. The text-indent/text-overflow trick will hide it in FireFox. But we then have to remove the excess padding using our browser select js class. Then Internet Explorer has a pseudo class for the select box down arrow indicator. We can use displa…
View hide-select-down-arrow.css
div.woocommerce form.woocommerce-ordering select,
body.woocommerce-page form.woocommerce-ordering select {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
background: url(images/arrow-down.png) no-repeat right center #fff;
height: 36px;
line-height: 1;
padding-right: 20px;
text-indent: 0.01px;
ChrisCree / taxonomy-title_functions.php
Last active Aug 29, 2015
Code to display the name of a category/tag/taxonomy as the title of an archive page in the Genesis framework.
View taxonomy-title_functions.php
// Do not copy opening PHP tag
// Display Category Title
remove_action( 'genesis_before_loop', 'genesis_do_taxonomy_title_description', 15 );
add_action( 'genesis_before_loop', 'genesis_do_custom_title_description', 15 );
function genesis_do_custom_title_description() {
if ( is_category() || is_tag() || is_tax() ) {
echo '<div class="archive-description taxonomy-description"> <h1>' . get_queried_object()->name . '</h1></div>';
ChrisCree / read-more-functions.php
Created May 21, 2014
The normal "read more" code for Genesis does not add the read more link to short manual excerpts. The blow code will do so.
View read-more-functions.php
// Do not copy opening PHP tag
// Add Read More button to blog page and archives
add_filter( 'get_the_content_more_link', 'wsm_add_excerpt_more' );
add_filter( 'the_content_more_link', 'wsm_add_excerpt_more' );
function wsm_add_excerpt_more( $more ) {
return '<span class="more-link"><a href="' . get_permalink() . '" rel="nofollow">' . __( 'Read More', 'wsm' ) . '</a></span>';
add_filter( 'the_excerpt', 'wsm_add_short_excerpt_more' );
ChrisCree / FullWidthHome_functions.php
Created Jun 11, 2014
Drop this code into your Genesis child theme functions.php file to force the home page to display with the full width content layout.
View FullWidthHome_functions.php
// Do not copy opening PHP tag above
// Force full width home page layout
add_filter( 'genesis_pre_get_option_site_layout', 'wsm_full_width_home_page' );
function wsm_full_width_home_page( $opt ) {
if ( is_front_page() ) {
$opt = 'full-width-content';
return $opt;
ChrisCree / EventsListWidget_functions.php
Created Jun 12, 2014
Remove the recurring info from the Events List widget in the The Events Calendar Pro.
View EventsListWidget_functions.php
// Do not copy opening PHP tag above
// Events Calendar - remove recurring event info
add_filter( 'tribe_events_recurrence_tooltip', 'wsm_remove_tec_recurring_info' );
function wsm_remove_tec_recurring_info( $tooltip ) {
if( !is_singular() )
$tooltip = '';
return $tooltip;
ChrisCree / childVersion-functions.php
Created Jul 23, 2014
To make your Genesis child theme display its version in the style sheet link instead of the Genesis version add this statement to your child theme's functions.php file.
View childVersion-functions.php
// Don't copy opening PHP tag above
// Define child theme version
define( 'CHILD_THEME_VERSION', wp_get_theme()->get( 'Version' ) );
ChrisCree / full-content-archives-genesis.php
Last active Aug 29, 2015 — forked from robneu/full-content-archives-genesis.php
Modified to display full content for posts in all categories.
View full-content-archives-genesis.php
// Do not copy opening PHP tag above
// Force content archves ti display full post content with no featured image
add_action( 'genesis_before_loop', 'wsm_full_content_categories' );
function wsm_full_content_categories() {
if ( is_category() ) {
add_filter( 'genesis_pre_get_option_content_archive_thumbnail', 'wsm_no_post_image' );
add_filter( 'genesis_pre_get_option_content_archive', 'wsm_do_full_content' );
add_filter( 'genesis_pre_get_option_content_archive_limit', 'wsm_no_content_limit' );
ChrisCree / taxtitle-functions.php
Created Aug 21, 2014
Add relevant page titles to custom taxonomy archive pages. This code can be dropped in the functions.php file. If used in a taxonomy.php template then omit the is_tax() conditional.
View taxtitle-functions.php
// Do not copy opening PHP tag above
// Add titles to custom taxonomy archive pages
add_action( 'genesis_before_loop', 'wsm_add_taxonomy_title' );
function wsm_add_taxonomy_title() {
if( is_tax() ) {
global $wp_query;
$term = $wp_query->get_queried_object();
$tax = $term->taxonomy;
You can’t perform that action at this time.