![Grid the articles In Blogger Homepage Grid the articles In Blogger Homepage](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBRAxpjubfc8X19DXki6zhpB1g_qEDh_zbjL9sBemSE0XBuBkSWfoYCNP7OYRtSXIAJ_i7SNEX93XRB6Dn6gfXdgaQxGS6IxVRkcQkOacyJoEgiVRFklpAE5f880ZGBv77BH73fsn31xlI/s1600/template+S12+grid+articles.png)
Actually, if you are an another responsive CSS framework's user that different than me, trust me this technique can be applicable also. I am sure because I have ever tried in many framework such as Bootstrap, Skeleton, W3.css, and Materialize.
What we have to do is only modifying the contents of the tag <b:include id='main'>. Our plan is converting from one post per line into four posts per line. Don't worry, we are using a framework right now, then we don't have to think that much about the style and the composition of the layout.
Please take a look at the picture below to understand my idea more :
![Article display 4 columns Article display 4 columns grid materialize](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjD7Hh9wBUv-ah9mCYHkZW6fOQkcQnFXK5-DTg0rGkYBd2cmx7l9HtQBkslWGi9Q6m5zsdOqDxBKnsMzyMtDgVldXt7YZ3pGXmxoXt45zDCtMepPVDnpUcc251WH4dK6phej01vJd5DG5lK/s1600/template+S13+display+4col.png)
First Step : The Understanding The Loop
Do you know, how can Blogger display every articles within the same format repeatedly? It is caused by the loop function. We learned about how to set the article format in the Homepage and Article Page. If you missed the topic, kindly check the article that I have written over here.Then, where is the loop that I am referring? For the short and to the point answer, I can say that it can be found easily by expanding the <b:include id='main'>. Of course, we are talking about modifying the widget id='Blog1'.
Second Step : The Source Code
Similary, when we set the article format in the main page / homepage display, and also when the title of the article is clicked. Inside the loop function, we have to set the both pages differently. The trick is by using the IF ELSE function plus combine it with the grid (row & col) class.Please take note and keep in tune the code that I provide below :
- Modify the <div class='blog-posts hfeed'> by inserting the class row. Then your code should be: <div class='row blog-posts hfeed'>.
- Start to insert the IF ELSE function and followed by the class col. Then your code will be :
Tidak ada komentar:
Posting Komentar