• Resolved kortschot

    (@kortschot)


    Can anybody shed some light on my Loop… the second part posts the permalink of the page instead of the remaining posts in the category…. I must be doing something wrong.

    <div id="main-content-werk">
    
            <div id="slider">
              <?php $my_query = new WP_Query('category_name=werk&posts_per_page=3');
               while ($my_query->have_posts()) : $my_query->the_post();
               $do_not_duplicate = $post->ID;?>
               <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><img src="<?php echo get_post_meta($post->ID, 'slider-image', true); ?>" alt="" title="<?php the_title(); ?>" /></a>
               <?php endwhile; ?>
             </div> <!-- END slider -->
    
             <br clear="all" />
    
            <?php if (have_posts()) : while (have_posts()) : the_post();
            if( $post->ID == $do_not_duplicate ) continue; ?>
              <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
    
            <!-- Do stuff... -->
    
            <?php endwhile; endif; ?>
    
        </div> <!-- end main-content-werk -->
Viewing 11 replies - 1 through 11 (of 11 total)
  • Chip Bennett

    (@chipbennett)

    You’re running two separate Loops.

    Try adding a wp_reset_query() between them?

    Thread Starter kortschot

    (@kortschot)

    yeah I did, thought it was still in there, not workin either. I used the codex page for multiple loops.

    here’s the full code of the page.

    https://pastebin.com/Wsf4g3Z1

    Chip Bennett

    (@chipbennett)

    Do you need to globalize $do_not_duplicate?

    You might try one of the other forums, e.g. WP-Advanced. You might have better luck having someone with more expertise with multiple Loops see/answer your question?

    Thread Starter kortschot

    (@kortschot)

    Thanks for the advice, ill check it out.
    The forum is closed though.. only moderators can paste threads there.

    Chip Bennett

    (@chipbennett)

    Strange. I don’t know what better forum to suggest, then. Maybe “How-To and Troubleshooting”, or “Plugins and Hacks”?

    Thread Starter kortschot

    (@kortschot)

    Thanks, ill repost it.

    Michael

    (@alchymyth)

    Thread Starter kortschot

    (@kortschot)

    wht do you mean…

    edit: oh =)

    ill check it out

    Thread Starter kortschot

    (@kortschot)

    oh dude!

    If you where a girl!

    thanks a bunch m8! works like a charm!

    Michael

    (@alchymyth)

    If you where a girl!

    no chance – no flowers please – i prefer a drink ??

    Thread Starter kortschot

    (@kortschot)

    beer it is =)

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘My Loop ain't Runnin!’ is closed to new replies.