Skip to content

Instantly share code, notes, and snippets.

View csbeck's full-sized avatar

Chris Becker csbeck

View GitHub Profile
@csbeck
csbeck / custom_archive_genesis_cb01
Last active December 10, 2015 23:48
Custom Archive listing page for use in Genesis. Includes pagination, showing custom fields content in posts which are in a category.
<?php
/**
* Template Name: New Tests Archive
*/
/** Remove original Primary Sidear -- add custom sidebar */
remove_action( 'genesis_sidebar', 'genesis_do_sidebar' );
add_action( 'genesis_sidebar', 'csbeck_custom_sidebar_archive' );
function csbeck_custom_sidebar_archive() {
@csbeck
csbeck / gist:5134677
Created March 11, 2013 14:37
Genesis Grid Template
<?php
/**
* Template Name: Portfolio Grid
* This file displays a Grid within a page.
*/
add_action( 'genesis_post_content', 'genesis_do_post_content' );
/**remove_action( 'genesis_loop', 'genesis_do_loop' );**/
add_action( 'genesis_loop', 'child_grid_loop' );
@csbeck
csbeck / gist:5136217
Last active December 14, 2015 19:19
Advanced Custom Genesis Grid Template
<?php
/**
* Possibly amend the loop.
*
* Specify the conditions under which the grid loop should be used.
*
* @author Bill Erickson
* @author Gary Jones
* @link http://code.garyjones.co.uk/genesis-grid-loop-advanced/
@csbeck
csbeck / style.css
Last active December 14, 2015 22:08
style.css for MikeMetcalfe site
/*
Theme Name: eleven40 Child Theme
Theme URI: http://www.studiopress.com/themes/eleven40
Description: eleven40 is a two or three column child theme created for the Genesis Framework.
Author: StudioPress
Author URI: http://www.studiopress.com/
Version: 1.1
Tags: black, blue, green, orange, red, white, dark, light, three-columns, two-columns, left-sidebar, right-sidebar, fixed-width, custom-menu, featured-images, full-width-template, post-formats, sticky-post, theme-options, threaded-comments
@csbeck
csbeck / gist:5605378
Created May 18, 2013 18:37
Page and Post - Custom text after Title but before content - Custom Admin Meta Box - (this is for adding to the functions.php - using Genesis framework)
<?php
/** Add custom meta box **/
add_action( 'add_meta_boxes', 'myplugin_add_custom_box' );
// backwards compatible (before WP 3.0)
// add_action( 'admin_init', 'myplugin_add_custom_box', 1 );
/* Do something with the data entered */
add_action( 'save_post', 'myplugin_save_postdata' );
@csbeck
csbeck / page_feature_loop.php
Created June 21, 2013 00:03
Genesis Feature Loop Page with Content on the top
<?php
/**
* This file adds a custom Genesis Loop */
/*
Template Name: Feature Loop Page
*/
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'child_grid_loop_helper', 55 );
@csbeck
csbeck / gist:5854118
Created June 24, 2013 22:08
Custom Archive Listing Page #01
<?php
/**
* Template Name: Professionals Listing Page
* Description: Used as a page template to show page contents, followed by a loop through a CPT archive
*/
remove_action ('genesis_loop', 'genesis_do_loop'); // Remove the standard loop
add_action( 'genesis_loop', 'custom_do_loop' ); // Add custom loop
@csbeck
csbeck / wp_customloginlogo
Created October 21, 2013 16:37
Add custom logo for WordPress login screen. Add it to the functions.php file.
@csbeck
csbeck / wp_search_in_category
Created November 20, 2013 20:34
Category search within a widget. Must include the PHP ability in widgets.
<!-- Search Form -->
<div style="margin:10px 0 10px 0;">
<form method="get" id="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>">
<table cellspacing="5">
<tr>
<td>
<label for="s" style="margin:10px;">Search in Categories</label>
</td>
<td>
<input type="text" class="field" name="s" style="width: 100px;"/>
@csbeck
csbeck / wp_php_code_in_widget
Created November 20, 2013 20:36
PHP code in WordPress widgets. Include this in the functions.php file.
// Add PHP functionality in Widgets
add_filter('widget_text','execute_php',100);
function execute_php($html){
if(strpos($html,"<"."?php")!==false){
ob_start();
eval("?".">".$html);
$html=ob_get_contents();
ob_end_clean();
}
return $html;