Skip to content

Instantly share code, notes, and snippets.

View kimwhite's full-sized avatar

Kim White kimwhite

View GitHub Profile
@kimwhite
kimwhite / gist:90408b87c71ddfd97895
Created July 30, 2014 19:38
> Read More < Show for Genesis Blog
// 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>';
}
@kimwhite
kimwhite / gist:f947992375143780c364
Created November 6, 2014 22:56
fix social icons with multiple parked domains
Added this to the .htaccess page
<FilesMatch "\.(ttf|otf|eot|woff)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>
//* 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:b68482c2770ce14b7075
Last active April 27, 2016 15:36
Add Excerpt to pages
/* add Excerpts to Pages */
add_action( 'init', 'my_add_excerpts_to_pages' );
function my_add_excerpts_to_pages() {
add_post_type_support( 'page', 'excerpt' );
}
@kimwhite
kimwhite / gist:93ec4fc730e0baa69481
Created June 17, 2015 20:44
Custom excerpt function - Genesis Sandbox widget
/* 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;
}
}
// Our custom post type function
function create_posttype() {
register_post_type( 'members',
// CPT Options
array(
'labels' => array(
'name' => __( 'Members' ),
'singular_name' => __( 'Member' )
),
/*
* 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' ),
/**
* 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 ) {
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);
<?
/*
* Register Helper fields for Mobile Phone and Birthdate.
*
*/
// Add All the content below this line to your to your PMPro Customizations page.
// We have to put everything in a function called on init, so we are sure Register Helper is loaded.
function my_pmprorh_init() {