In Minimum Pro’s theme demo, the homepage has 6 Posts appearing in columns via Settings > Reading with front page set to display latest posts for this. For the standard listing of blog posts, Blog Page Template would need to be applied to a static Page.
As you are probably aware by now, it’s NOT recommended to use Blog Page Template that comes shipped with Genesis.
Let’s see how we can fix this in Minimum Pro.
Step 1
Create a Page named say, Home
and another say, Blog
. These can be left empty (content-wise). Do not apply Blog Page Template to the Blog Page.
Step 2
Edit front-page.php.
a) In minimum_front_page_genesis_meta()
, comment out or remove the is_home()
if conditional (lines 32 and 48).
b) Replace
//* 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(); | |
} | |
} |
with
//* 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 ); | |
} |
Step 3
Add the following in Minimum Pro’s functions.php:
// 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>'; | |
} |
Step 4
At Settings > Reading, set Front page to display a static page with Home
as the Front page and Blog
as the Posts page.
Thanks to Chinmoy for providing the code that takes care of fixing the issue with pagination in custom loops.