Skip to content

Instantly share code, notes, and snippets.

kimwhite

Block or report user

Report or block kimwhite

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
View category query
if (is_category('Glossary'))
{
$args = array( 'posts_per_page' => -1, 'orderby'=> 'title', 'order' => 'ASC' );
$glossaryposts = get_posts( $args );
}
foreach( $glossaryposts as $post ) : setup_postdata($post);
View toggle post title - with plugin for pages
/**
* Add Genesis Title Toggle to Posts
*
* @link http://www.billerickson.net/code/genesis-title-toggle-for-posts
* @author Bill Erickson
*
* @param array $post_types
* @return array
*/
function be_title_toggle_on_posts( $post_types ) {
View detailed custom post type
/*
* Creating a function to create our CPT
*/
function custom_post_type() {
// Set UI labels for Custom Post Type
$labels = array(
'name' => _x( 'Members', 'Post Type General Name', 'twentythirteen' ),
'singular_name' => _x( 'Member', 'Post Type Singular Name', 'twentythirteen' ),
View custom post type
// Our custom post type function
function create_posttype() {
register_post_type( 'members',
// CPT Options
array(
'labels' => array(
'name' => __( 'Members' ),
'singular_name' => __( 'Member' )
),
@kimwhite
kimwhite / gist:93ec4fc730e0baa69481
Created Jun 17, 2015
Custom excerpt function - Genesis Sandbox widget
View gist:93ec4fc730e0baa69481
/* custom excerpt function for the homepage */
function excerpt_read_more_link( $output ) {
if ( is_home() ) {
global $post;
return $output . '<a class="more-link" href="' . get_permalink( $post->ID ) . '" title="' . get_the_title( $post->ID ) . '">Read more ... </a>';
} else {
return $output;
}
}
View gist:b68482c2770ce14b7075
/* add Excerpts to Pages */
add_action( 'init', 'my_add_excerpts_to_pages' );
function my_add_excerpts_to_pages() {
add_post_type_support( 'page', 'excerpt' );
}
View gist:f5f5ef784d858c375d5d
//* Add Gravity Forms Permission for Editor
function add_grav_forms(){
$role = get_role('editor');
$role->add_cap('gform_full_access');
}
add_action('admin_init','add_grav_forms')
@kimwhite
kimwhite / gist:f947992375143780c364
Created Nov 6, 2014
fix social icons with multiple parked domains
View gist:f947992375143780c364
Added this to the .htaccess page
<FilesMatch "\.(ttf|otf|eot|woff)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>
@kimwhite
kimwhite / gist:90408b87c71ddfd97895
Created Jul 30, 2014
> Read More < Show for Genesis Blog
View gist:90408b87c71ddfd97895
// Add Read More Link to Excerpts
add_filter('excerpt_more', 'get_read_more_link');
add_filter( 'the_content_more_link', 'get_read_more_link' );
function get_read_more_link() {
return '...&nbsp;<a href="' . get_permalink() . '">[Read&nbsp;More]</a>';
}
You can’t perform that action at this time.