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.
Thanks for the tutorial! I’ve been wondering about this for some time now. I’m glad and extremely thankful I finally joined up as a member to get the great information you provide!
One issue I’m having is by commenting out line 32 & 48 everything seems fine, but my blog posts are still showing up on what is now my “static homepage” just as they did prior with settings/reading/ “front page displays latest posts”. (yes I made correct adjustments in reading/settings after new code)
I took further action and completely removed the code between line 32 & 48, scary I know, but it’s ok because this is just a test site I’m using to experience these changes. Once I removed this remaining code in front-page.php I immediately had my “HOME” page entry title showing below home-featured-4 area.
Upon viewing my source code (I don’t know much about markups & schema etc.) I noticed that now my new “static homepage” has the H1 at the bottom of the page with an unsightly “HOME” showing below my home featured 4 area.
So I took reverse action, replaced the old removed front-page.php code between line 32 & 48 and as it was once before and then my posts showed up again. Upon viewing this source code I noticed that my “MainContentofPage” has the “blog / schema/blog” markup, but so does my new static created “BLOG” page.
Is it ok for both the new “static” homepage and the new “static” blogpage to both have this markup. (I know it’s an seo question, but thought I’d just throw it in at hopes for an understanding)
Additionally, do you have any thoughts on how to completely remove the posts or if removing the code between 32 & 48 the HOME that show on my now new static homepage?
Thanks in advance!
I do not know. My guess is that it is ok.
To not show blog posts on the front page, just comment out
add_action( 'genesis_loop', 'minimum_grid_loop_helper' );
in front-page.php.
Thanks! The removal of…
add_action( ‘genesis_loop’, ‘minimum_grid_loop_helper’ );
did remove my posts from the new static homepage.
Unfortunately after further review, I looked at my new static created BLOG page and viewed it’s source code and It has the same H1 tag that my static HOME page has. They both use my site’s title, so I have 2 pages with the same H1 tag.
In addition, the static BLOG page has all of my blog post entry titles as H1’s as well. An argument could be made for having multiple H1’s , but combining that with the other markup issues/concerns, I’ll just have to choose another theme.
Thank you for your help!
This is not specific to Minimum Pro.
To change the heading tags from h1 to h2 for entry titles in content archives in any Genesis site, go to Genesis > SEO Settings and uncheck “Use semantic HTML5 page and section headings throughout site?” under “Section Headings”.
Hi Sir.i am facing problem in eleven 40, blog home page , in post navigation, when i click on next page or 2,3 it show the same post….
Can you provide the URL of your site?
Hi! Thanks for the tutorial, I’ve made the changes in my current theme (I had no idea about this).
I have one question. I know it’s probably going to sound stupid for you but… Hahah. So I’m creating a child theme from scratch and it has a static front page. I have a blog page that display the posts but the title “Blog” shows above the entry.
Putting .archive-description.posts-page-description {display:none} in the stylesheet removes the blog title but I was wondering what developers usually do to remove it. I’ve looked into 3 themes (which have a static home page and no blog title on the blog page) I’ve bought last year I’ve looked into their Functions, stylesheets, front pages… But I still can’t find anything that would possibly be related to this. Could you please help me? (I know this is silly but it’s something that’s really bothering me in this theme I’m making >.<). (Also sorry for my English, hope you understand what I mean hahah)
Thank you again and have a nice week!
X
Follow https://sridharkatakam.com/remove-posts-page-heading-genesis/
Hi all,
I am using Minimum-pro theme with Genesis.And I have done below setting for Reading:
Front page setting: Your latest posts
For this setting the home is getting displayed as I excepted , but the Blog page is appearing blank.
And if I change above setting to as follow:
1) Front page setting: Static pages
Front page: Home page
Blog page: Blog page
The Blog page lists all latest post , but on home page it is not displaying the blog list and other content like slider on home page is coming properly.
Please tell me if I have missed anything.
Thanks in advance,
Komal.
Hi All,
I have applied all the change mentioned above to my site.
I am using word press 4.6, and is is working fine for as home page and blog page list, but the pagination on home page showing error like page not found.
Can you please me solve this?
Thanks in advance,
Komal Barde