Last active
August 29, 2015 14:27
-
-
Save srikat/aaada72e31fc82fe5ff9 to your computer and use it in GitHub Desktop.
Fixing the Blog Page Template issue in Minimum Pro. https://sridharkatakam.com/how-to-fix-the-blog-page-template-issue-in-minimum-pro/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Set content limit to 250 words | |
function sk_content_limit() { | |
return '250'; | |
} | |
// Modify the Genesis content limit read more link | |
add_filter( 'get_the_content_more_link', 'sp_read_more_link' ); | |
function sp_read_more_link() { | |
return '... <a class="more-link" href="' . get_permalink() . '">[Read more]</a>'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* Genesis grid loop | |
function minimum_grid_loop_helper() { | |
if ( function_exists( 'genesis_grid_loop' ) ) { | |
genesis_grid_loop( array( | |
'features' => 0, | |
'feature_image_size' => 0, | |
'feature_content_limit' => 0, | |
'grid_image_size' => 0, | |
'grid_content_limit' => 250, | |
'more' => __( '[Read more]', 'minimum' ), | |
) ); | |
} else { | |
genesis_standard_loop(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* Genesis grid loop | |
function minimum_grid_loop_helper() { | |
global $paged; | |
// Fix for the WordPress 3.0 "paged" bug. | |
$paged = 1; | |
if ( get_query_var( 'paged' ) ) { | |
$paged = get_query_var( 'paged' ); | |
} | |
if ( get_query_var( 'page' ) ) { | |
$paged = get_query_var( 'page' ); | |
} | |
$paged = intval( $paged ); | |
// arguments, adjust as needed | |
$args = array( | |
'posts_per_page' => 6, | |
'paged' => $paged | |
); | |
/** | |
* Display as Columns | |
* | |
*/ | |
function sk_grid_post_class( $classes ) { | |
global $wp_query; | |
$classes[] = 'genesis-grid'; | |
$classes[] = ( $wp_query->current_post % 2 == 0 ) ? 'genesis-grid-odd' : 'genesis-grid-even'; | |
return $classes; | |
} | |
add_filter( 'post_class', 'sk_grid_post_class' ); | |
// Force content limit | |
add_filter( 'genesis_pre_get_option_content_archive_limit', 'sk_content_limit' ); | |
genesis_custom_loop( $args ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment