Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 704275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:55:26+00:00 2026-05-14T03:55:26+00:00

I am modifying a wordpress theme completely, and have run into one very simple

  • 0

I am modifying a wordpress theme completely, and have run into one very simple problem. Please look at my page here: wordpress blog When you scroll down, you can see the one blank area under the first post. For some reason, that block isn’t floating left. Each post has the following css that fits in a 645px container:

.home-post-wrap { width: 285px; margin:0; float: left; background-color: #FFF;  padding: 15px; overflow: hidden; border-bottom:1px dotted #C5C5C5; border-right:1px dotted #C5C5C5; }

Any idea on how to make the page flow correctly here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T03:55:27+00:00Added an answer on May 14, 2026 at 3:55 am

    crimson_penguin is correct. It’s because the columns are different heights. Every 2 columns you wan’t to do a clear. The easiest thing to do here would look at the index of the loop and echo a clearfix after every 2. You can do this with modulo, and/or apply a class to the ones at 1, 3, 5, etc... to clear:left.

    Here is a PHP function of mine that I use to clear.

    <?php
        public static function cycle($count, $odd = 'odd', $even = 'even') {
            return ($count % 2) ? $even : $odd;
        }
    ?>
    

    Basically, you pass it three arguments (the second and third are optional) where the first is the $count, or the object to look at (for example $i in a for loop) and $odd / $even are strings to be used when an odd or even item in the loop is encountered.

    Here it is in action:

        <?php foreach ($products as $key => $product): ?>
            <li class="<?= Template::cycle($key) ?>">
                <img src="<?= $product->get_photo('small') ?>" />
                <div class="productMeta">
                    <h3><a href="<?= $product->get_absolute_url() ?>"><?= $product->get_full_name() ?></a></h3>
                    <p><?= $product->get_description() ?></p>
                </div>
            </li>
        <?php endforeach; ?>
    

    I’m doing the cycle on the $key which in this case happens to be 0, 1,... n. The result is the following:

    <li class="odd"> 
        <img src="http://arbesko.dev/wp-content/themes/arbesko/img/products/small/465.jpg" />
        ...
    </li> 
    
    <li class="even"> 
        <img src="http://arbesko.dev/wp-content/themes/arbesko/img/products/small/935.jpg" /> 
        ...
    </li> 
    
    <li class="odd"> 
        <img src="http://arbesko.dev/wp-content/themes/arbesko/img/products/small/350.jpg" />
        ...
    </li>
    

    Simply apply some clear:left to the odd ones, and you’ll be all set!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am modifying my PHP network's code to have user roles like wordpress here
Im modifying a theme in wordpress and would like to have the possibility to
im looking easy steps for convert any html/php template into a very simple wordpress
Modifying CKEditor 3.6.2 is not easy, but I tried hard . One problem that
(Modifying the question)I have a windows form app in C# which calls into some
Modifying a SnapPages theme, meaning I only have access to the CSS stylesheet. I
I am modifying a website on wordpress (codex) and I would like to import
I am modifying the tutorial found here: http://www.w3schools.com/ajax/ajax_aspphp.asp so that the library of autocomplete
I am modifying a theme and pulling data out of my PODS tables. I
I am modifying a wordpress template and need to slightly separate rendering logic for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.