• As a premise I need to mention that I’m not a programmer or developer, so my technical knowledge of getting it working is fairly limited. That being said, I’ve been looking around to get the right type of code (with some tweaking) to get it to work, but no dice. I’ve also tried searching for a solution throughout the forum.

    I think the problem is better understood with a diagram of what I’m trying to achieve. Here’s also a screenshot to show exactly what it looks like (you can see how the post is repeated already).

    The majority of the problem I have seems to be that there are 3 different post layouts that I’m trying to integrate into the loop: 1) the feature carousel at the top, 2) the middle section with the posts being vertical, and 3) the rest of the posts in horizontal below.

    • Posts can’t appear twice on the page
    • The following pages will be a different layout (only the homepage to appear in this layout)

    I’ve actually posted the question here with the full code if it might help. Thank you your help is much appreciated.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter sundayx

    (@sundayx)

    One day bump.

    Thread Starter sundayx

    (@sundayx)

    Believe me I’ve looked through that through and through but I’m desperately stuck.

    So what I did was break it down to the raw basics, this is what I have, meaning also that I’ve done the first 2 parts. What’s left for me is to return the rest of the posts (and not duplicate to what’s being shown already) and this is where I have completely no clue.

    Please help.

    <?php $my_query = new WP_Query('tag=starred&posts_per_page=5');
      while ($my_query->have_posts()) : $my_query->the_post();
      $do_not_duplicate[] = $post->ID ?>
    <!-- do carousel stuff -->
    <?php endwhile; ?>
    
    <?php query_posts(array('post__not_in'=>$do_not_duplicate, 'posts_per_page'=>4));
     if (have_posts()) : while (have_posts()) : the_post();
     ?>
     <!-- do loop stuff -->
    <?php endwhile; endif; ?>

    [Please post code or markup snippets between backticks or use the code button.]

    the code looks ok – where directly is the problem, and can you post a link to your site to illlustrate the output of the above code?

    just keep going with a third loop – integrate the $do_not_duplicate[] into the second loop, and use ‘post__not_in’ again in the third loop …

    Thread Starter sundayx

    (@sundayx)

    Thanks alchymyth. The problem is I have no idea to create the third loop that continues the second. This is what I have, I know exactly what’s wrong with it (the 3rd loop is running through the query again and returning the 4 posts once again from the 2nd loop) but I have no idea how I can tackle it. Thank you.

    [code moderated – please use the pastebin for any code over 10 lines]

    Thread Starter sundayx

    (@sundayx)

    Anyone?

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Help with Loop and Multiple Styles’ is closed to new replies.