• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » WordPress Genesis Home Page Grid With CSS Column

By Abhishek Ghosh April 23, 2015 8:44 am Updated on April 23, 2015

WordPress Genesis Home Page Grid With CSS Column

Advertisement

Here is how to get WordPress Genesis home page grid with CSS column without any plugin or even front-page or home template. Very easy to create. Genesis and other paid themes can not compete with the recent changes for schema markups. At the time of publication of this article, you can check official StudioPress blog is failing to pass Google Microformat Testing Tool, but we are passing. Most wants a semi static home page and people writes most difficult ways to create grid in responsive design. Our basic target is to – decrease the number of queries and PHP snippet. PHP is not as good as Python or even Perl.

Table of Contents

  • 1 Introduction
  • 2 Initial Steps
  • 3 WordPress Genesis Home Page Grid
  • 4 Centering in Responsive Design
  • 5 Showing Recent Posts With PHP Snippet
  • 6 How it Works

 

WordPress Genesis Home Page Grid With CSS Column : Plan The Things

 

Basically all needs some boxes or call to action stuffs on homepage plus the latest posts. What will be your layout is your matter, but you can conditionally add plain HTML stuffs on front-page using Genesis Simple Hooks Plugin in this way in the “genesis_before_content_sidebar_wrap” Hook box (enable Execute PHP on this hook by tick mark) :

Advertisement

---

The above gist is loading as async defer script in non-blocking way. We are not even loading the CSS on other webpages like posts. Very easy. Plain HTML and CSS. Now we need to remove the fucking navigation on homepage only :

When W3TC will cache it, there will no stress on the database or extra PHP query. This is a bit advanced usage of what we did with drop caps on Posts only. If you have lot of images on homepage as slider, use Base64 data URI. Google dislike that navigation on serious website – they becomes repeat if you consider the categories. By this time, you got a better looking homepage.

But we promised you – WordPress Genesis Home Page Grid With CSS Column. If you are browsing this webpage via desktop, then pull the ear of your browser window to look it like a mobile and navigate below this article where related articles are present. The thing is Yet Another Related Post but we added micro data with custom template. You will see – on desktop there are three columns. When you’ll make it smaller – it will become 2 columns. Excellent responsive idea for home page recent posts. Grid is nothing but a visual matter.

WordPress-Genesis-Home-Page-Grid-With-CSS-Column

 

WordPress Genesis Home Page Grid With CSS Column

 

You definitely have some horizontal separators between the recent posts. Like “—–“. If you add column like “|”, it becomes like “H”. But when you’ll go for mobile, it should become like “[ ]”. The columns should break to normal condition. We will add only a CSS :

So the final code would be :

No body has told you to not use PHP within the HTML divs. You can easily add. If you want to position the post images on homepage over the title, you need to reposition. Adding a small snippet on child theme’s functions.php will work fine :

Vim
1
2
3
4
5
6
7
function tcw_reposition_home_image() {
     if ('is_archive') {
remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
add_action( 'genesis_entry_header', 'genesis_do_post_image', 8 );
}
}
add_action( 'genesis_before_content', 'tcw_reposition_home_image' );

We used tcw_reposition_home, you can change it with the name you like. Now, from the Genesis Theme settings page, activate “Include the Featured Image” by tick mark and select a horizontally bigger image. We do not use it as it increases the HTTTP requests.

Indeed, you can show recent posts from one category using Doug Edgington’s this snippet on child theme’s functions.php file :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function dee_display_recent_posts() {
$args = array(
'post_type' => 'post',
'posts_per_page'=> 5,
'cat'=> 4,
);
$dee_recent_posts = new WP_Query( $args );
if( $dee_recent_posts->have_posts() ):
$dee_output = '<ul>';
while ( $dee_recent_posts->have_posts() ) : $dee_recent_posts->the_post();
$dee_output .= '<li><a href="' . get_permalink() . '" title="' . get_the_title() . '">' . get_the_title() . '</a></li>';
endwhile;
$dee_output .= '</ul>';
endif;
return $dee_output;
wp_reset_postdata();
}
add_shortcode( 'recent-posts', 'dee_display_recent_posts' );

[recent-posts] is the short code here. What more a template offers? Less, it adds more burden on the server.

 

Extra : Centering in Responsive With CSS

 

Now, look at our sidebars Ads and again pull the ear of your browser window to make it like a mobile. You’ll see that our Ads are remaining in the center. We wrapped the divs with :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
<div class="google-doubleclick">
 
</div>
<style>
.google-doubleclick {
background-color: #EEEEEE;
background-repeat: no-repeat;
max-width:300px;
max-height:100%;
margin:0 auto;
text-align: center;
}
</style>

max-width:300px is fixed for this case as the container is bigger than 300px in width when responsive, but generally max-width:100%; usually works.

Have we asked money from you? Simple work, if you read here and there; you could also write it. We do not ask for Nginx PHP5 FPM Fix, we asked money for this small thing?

You want design? There are hundreds of design for free on Github. Get the CSS and HTML and modify. Simple.

 

How Home Page Grid With CSS Column Works and Why It is Not For Category Pages

 

We have removed the pagination. All the posts became under the div class named content. If you add this for Category, the numbering unfortunately will get fully messed up. The only way is to add a new div class after the itemprop maincontentOfpage i.e. at the beginning of the posts loop. But ending the div before the navigation ois very difficult. It probably need a template modification. Again the problem of closed source becomes apparent. After huge trial and error normally a solution for category page will be discovered.

As the post titles will never have exactly the same number of words, there will be small problem in cometic appearance, it will not be exact grid but a more realistic stuff – like Newspaper Columns.

Tagged With home page cloumn , CSS grid

This Article Has Been Shared 839 Times!

Facebook Twitter Pinterest
Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to WordPress Genesis Home Page Grid With CSS Column

  • Installing WordPress via PHP Script : Cloud Sites and Other WebHosts

    Installing WordPress via PHP Script is a very way to install WordPress on your Server via FTP without Shell Access. The script automatically download and unzip.

  • mod_pagespeed and Google PageSpeed Service

    mod_pagespeed and Google PageSpeed Service has been evaluated and from our tests some parts of mod_pagespeed is good but Google PageSpeed Service lags far away.

  • Creating Spinning Logo for WordPress Genesis and Others

    Creating Spinning Logo for WordPress Genesis and Other Themes is quite easy. Move the mouse over the logo and it will spin. You can control the speed,behavior.

  • WordPress Optimization Tricks : The PHP Files

    WordPress optimization tricks offers you some uncommon and common hacks to optimize the Page Loading speed specific to WordPress files only.

  • W3 Total Cache Pro and WordPress Page Loading Speed

    W3 Total Cache Pro has recently been introduced by W3TC Plugin developer and here is some questions frequently asked by the WordPress users as suggestion.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (22.1K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • What Is A Digital Media Consultancy? May 17, 2022
  • How Artificial Intelligence (AI) Is Changing The Way We Play Bingo May 16, 2022
  • Why You Need A Big Data Consultant May 15, 2022
  • The Connection Between AI And Online Slots May 13, 2022
  • How To Choose Your Niche As An Instagram Influencer May 12, 2022

About This Article

Cite this article as: Abhishek Ghosh, "WordPress Genesis Home Page Grid With CSS Column," in The Customize Windows, April 23, 2015, May 18, 2022, https://thecustomizewindows.com/2015/04/wordpress-genesis-home-page-grid-with-css-column/.

Source:The Customize Windows, JiMA.in

This website uses cookies. If you do not want to allow us to use cookies and/or non-personalized Ads, kindly clear browser cookies after closing this webpage.

Read Privacy Policy.

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2022 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy