• Hi!

    Ive have a row of 4 posts, and i want to make a grid out of it, 2 top, 2 bottom. Anyone who cant point me in the right direction? Been scanning google for a while but cant get it to work properly. This is the code im trying to get a grid out of:

    <div class="views">
    <div id="poppost">Popul?rt</div>
    <ul id="popular-comments">
    <?php
    $pc = new WP_Query('orderby=comment_count&posts_per_page=4'); ?>
    <?php while ($pc->have_posts()) : $pc->the_post(); ?>
    <div class="span-12<?php if (($i%4)==0) { ?> last<?php } ?>">
    <li>
    <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s','gpp_i18n'),the_title_attribute('echo=0')); ?>"><?php the_post_thumbnail('310x150'); ?></a>
    <div class="title-overlay3">
    h7 class="titel5"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s','gpp_i18n'),the_title_attribute('echo=0')); ?>"><?php the_title() ?></a></h7>
    </div>
    <p>
    </li>
    <?php endwhile; ?>
    </ul>
    </div>

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • you will possibly need to edit this line:

    <div class="span-12<?php if (($i%4)==0) { ?> last<?php } ?>">

    for instance change $i%4 to $i%2, and probably adapt the .span-12 class according to your used framework;

    and possibly adapt some css styles.

    details are impossible to suggests from the posted code alone.

    a live link to your site might help.

    Thread Starter jerryskate

    (@jerryskate)

    Thanks for the reply, heres the link to the site. Very rough, and a lot of “i-dont-know-what-im-doing” typ of coding…

    https://www.harbourmagazine.se/

    Thread Starter jerryskate

    (@jerryskate)

    Its the row on the right. The posts are to wide at the moment, but ill fix that. just was trying to figure out how to make it into a grid.

    as you are working with the commercial theme ‘modularity’ please contact the theme’s vendor graphpaperpress for support;

    commercial themes are not supported by this forum.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Create a postgrid (2 columns)’ is closed to new replies.