How to create a blog page ?


Hello Emmanuel,

If you want a static homepage and your blog on a subpage like /blog, I would first recommend to create the pages “Home” and “Blog” in your WordPress admin. Then, go to "Settings > Reading" and set those as the appropriate pages to be used.

If you want to control the look of your blog "page", add a home.php file in your child theme. With Beans, it is very easy to customize it.

Let's say that you want your posts to be split (content/image). You could add this snippet to your home.php template.


<?php

 // Remove tags and categories.
 beans_remove_action( 'beans_post_meta_categories' );
 beans_remove_action( 'beans_post_meta_tags' );

 // Adjust post title.
 beans_add_attribute( 'beans_post_title', 'class', 'uk-h2 uk-margin-small-bottom uk-margin-small-top' );

 // Add post grid attributes.
 beans_add_attribute( 'beans_post', 'class', 'uk-grid' );
 beans_add_attribute( 'beans_post', 'data-uk-grid-margin', '' );

 // Adjust image and move it before the beans_child_post_content wrap.
 beans_add_attribute( 'beans_post_image', 'class', 'uk-width-medium-1-3' );
 beans_modify_action_hook( 'beans_post_image', 'beans_child_post_content_before_markup' );

 // Wrap beans post content and adjust post content.
 beans_wrap_inner_markup( 'beans_post', 'beans_child_post_content', 'div' );
 beans_add_attribute( 'beans_child_post_content', 'class', 'uk-width-medium-2-3' );

// Load Beans
beans_load_document();

Hope it helps ! 🙂

Mathieu


Hi Mathieu !

Hey, so easy ! Thank you a lot, I appreciate the time you take to answer with pertinent informations.

I think I will continue to learn wordpress/getbeans and maybe in the future I could help 🙂

Hope the project will continue for a long term ! Regards, Emmanuel

Write a reply

Login or register to write a reply, it's free!