PLEASE HELP ME: query posts???
-
Problem:
How to create several div’s with different post categories?
I tried a lot, didn’t get more than this. I can create several loops, but the second one doesn’t dissapear when going to the page of the post. I hope you understand and can help me. 🙂 PLEASE!
Sample: http://www.ukkepurk.nl/blog
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php if ( in_category('3') ) { ?> <div class="post-cat-three"> <?php } else { ?> <div class="post"> <?php } ?> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> <small><?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?></small> <div class="entry"> <?php the_content(); ?> </div> <p class="postmetadata">Posted in <?php the_category(', '); ?></p> </div> <?php endwhile; else: ?> <p>Sorry, no posts matched your criteria.</p> <?php endif; ?> <?php $myquery = new WP_Query('category_name=last'); ?> <?php while ($myquery->have_posts()) : $myquery->the_post(); ?> <!-- Display the Post's Content in a div box. --> <div class="entry"> <?php the_content(); ?> </div> <?php endwhile;?> <?php wp_reset_query(); ?>
2 reacties aan het bekijken - 1 tot 2 (van in totaal 2)
2 reacties aan het bekijken - 1 tot 2 (van in totaal 2)
- Het onderwerp ‘PLEASE HELP ME: query posts???’ is gesloten voor nieuwe reacties.