• Resolved Robert

    (@robertjakobson)


    Well, the problem is that querying for post with meta_value_num works but if one tries to float the results for example with float:left utter gibberish happens.

    With order=ASC the orphan (the last post to be querried and that happens to be on the new line) gets to be on the right.

    With order=DESC the orphan goes towards the left, but leaves the space of one empty element.

    The code follows:

    CSS:

    .contact {
    float: left;
    text-align:left;
    margin:0px 18px 38px 0px;
    border-right: 1px solid #d9d9d9;
    padding-right: 9px;
    margin-right: 9px;
    margin-bottom: 22px;
    }
    
    WordPress markup:
    
    <?php $temp_query = $wp_query; ?>
    <?php query_posts('category_name=contacts&showposts=16' . '&meta_key=arv' . '&orderby=meta_value_num&order=asc'); ?>
    <?php while (have_posts()) : the_post(); ?>
    <div class="contact">
    <div class="exportContact" id="post-<?php the_ID(); ?>">
    <h3><?php the_title();?></h3>
    <div class="pictureContact"><?php echo get_the_post_thumbnail(); ?></div>
    <div class="h-line"><hr /></div>
    <div class="teamContact">
     <?php the_content(''); ?>
     </div><!-- teamContact -->
    </div><!-- exportContact !-->
    </div><!-- contact !-->
    <?php endwhile; ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Robert

    (@robertjakobson)

    This is really strange, changing num to number changes the layout to the correct version when desc but when asc it is still incorrect.

    Also when chaning num to number the post with largest number gets put last, even though it needs to be first, which makes it unusable.

    Really, really strange.

    Thread Starter Robert

    (@robertjakobson)

    There is zero logic to this, totally bad, bad, bad, bad.

    At one point I got the configuration of “number” + “desc” working. But now there is the empty space of the width of one post between the orphaned post on the last line and the left border of the containing element. Absolutely and clearly no logic what so ever.

    Thread Starter Robert

    (@robertjakobson)

    Needed to add height to the .contact div to resolve the display / appearance. Still checking about the other problem.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘query_posts with meta_value_num and float:left;’ is closed to new replies.