Custom loop to call specified posts
-
Hi, i’ve been trying to make the menu of the first loop call the content of the referent post in the second loop, but didn’t work, help please!
<?php if (have_posts()) : ?> <div class="servicenavigation"> <img src="/images/separadorhor.png"> <li> <?php while (have_posts()) : the_post(); ?> <?php $cat = get_cat_id('servicos'); $servicos = new WP_Query(); $servicos->query('&cat='.$cat); while ($servicos->have_posts()) : $servicos->the_post(); ?> <a href="<?php echo get_permalink(); ?>"><?php the_thumb(); ?></a> <?php endwhile; ?> </li> <img src="/images/separadorhor.png"> <?php $cat = get_cat_id('servicos'); $servicos = new WP_Query(); $servicos->query('&showposts=1'.'&cat='.$cat); while ($servicos->have_posts()) : $servicos->the_post(); ?> <div class="entry"> <?php the_content('Read the rest of this entry »'); ?> </div> <?php endwhile; ?> <img src="/images/separadorhor.png"> </div> </div> <?php endwhile; ?>
The topic ‘Custom loop to call specified posts’ is closed to new replies.