• 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 868 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 (24.3K 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

  • Cyberpunk Aesthetics: What’s in it Special January 27, 2023
  • How to Do Electrical Layout Plan for Adding Smart Switches January 26, 2023
  • What is a Data Mesh? January 25, 2023
  • What is Vehicular Ad-Hoc Network? January 24, 2023
  • Difference Between Panel Light, COB Light, Track Light January 21, 2023

About This Article

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

Source:The Customize Windows, JiMA.in

PC users can consult Corrine Chorney for Security.

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

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

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

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT