• Resolved trome

    (@trome)


    I want to change the grid size to 4 column. By default it is 3 columns. What file do I need to edit? I know I will likely have to hack the php code, which I can do. I just need to know which file to edit.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi Trome,

    Which columns do you need to modify? Are you talking about the main content in the home page?

    If it’s the home page, the file to modify should be content-home.php. To proceed in the right way, duplicate this file into your child theme and modify this line that you find towards the top of the page:

    <article id="post-<?php the_ID(); ?>" <?php post_class("archive artmain col-md-4 col-sm-8 col-xs-12"); ?>>

    by replacing col-md-4 with col-md-3

    These are Bootstrap grid classes: the sum of all columns must amount to 12 to make up a row (4+4+4=12; 3+3+3+3=12).

    I hope this helps ??
    – Maria Antonietta

    Thread Starter trome

    (@trome)

    I did change from col-md-4 to col-md-3, but that only changed the width of each column to 25%.

    I just found the answer. It is on line 13 of the home.php file. I changed

    if ($ink_count == 2)

    to

    if ($ink_count == 3 )

    That changed the layout to 4 columns. Take a look here:

    https://neurology.tammyrome.com/

    Oh yes, that completes the code. That’s great!

    I couldn’t access your link, but I’ve been using the theme’s code here in the WP.org repository.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Home page – customize post grid’ is closed to new replies.