Support » Themes and Templates » Positioning posts

  • Hey guys & gals!

    First off thanks for taking the time to help me out with this, I am still pretty new to WP and am using it for my graphic design portfolio.
    I’ll try my best to describe what I am trying to accomplish.

    In my theme, I have the layout setup to show 4 column posts and I would like to have additional posts show directly below (which they do) but without a huge gap in spacing like I am currently getting.

    It’s wierd, if you go to my site currently, you can see that the 5th post “WHAT THE FUBAR” is doing exactly what I want it to, but the other 3 posts, “C&W” “ALLPHASE” and “ELITETECHS” are almost being pushed to the bottom of the page with a huge gap in between them.

    The HTML markup:
    [huge chunk of code moderated – please use a pastebin or link to file]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Sorry about that, I will pastebin the code now!

    CSS: CSS

    Hopefully the post above makes sense, If you need any other information please let me know. Thanks for any help anyone can provide!
    Please help! 🙁

    There’s a couple of ways I can think of right now.

    One: Using jQuery Masonry

    Two: this is a bit longhand you could position your boxes in 4 columns, and within each column use query posts with some offsetting etc.

    For example (this isn’t actual code- it’s just an idea):

    <?php query_posts('showposts=1&cat=3'); ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class="item">
    <!-- the_content etc -->
    <?php endwhile; endif; ?>
    <?php query_posts('showposts=1&cat=3&offset=4'); ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class="item">
    the_content etc
    <?php endwhile; endif; ?>

    and repeat that four times, adjusting the offset so that the posts display in the order you want.

    If you don’t get what I’m saying, let me know and I’ll try again.

    There are probably lighter ways of doing it.

    Nice site, by the way!

    Hey Josh, thanks so much for a reply! I was starting to get worried. From the looks of it the Masonry thing looks a little bit easier to accomplish, but when I tried applying the code to index.php it made my posts into one column instead of the desired effect.

    I just reverted the changes. Is there any way you can look at the pastebin files I included above and tell me what needs to change in my CSS/HTML files?

    I really appreciate it! and thanks for the compliment on my site! It’s the first time I’ve tried using WP on my own site.

    anyone else experienced with the masonry script?

    Hey chap, no problem. It would be a bit easier to show you what I mean if you posted the index.php of your theme, not the output HTML…

    But basically the method I envisaged (and failed to properly articulate) was to use a seperate query for each post displayed, and position those queries in columns. This would achieve the same effect as the masonry script (which I’m sorry I haven’t used), but would need more php markup and database calls…

    I see you got it working with the masonry script- out of interest- was that difficult?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Positioning posts’ is closed to new replies.