Posted By

arpit on 04/01/09


Tagged

wordpress


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

secondtwo
lilumi
joelhaus
booski
fyreflyX


Wordpress: Page with content from only a particular category


 / Published in: PHP
 

  1. <?php query_posts('cat=3&showposts=10'); ?>
  2. <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
  3. <div class="blog-entry">
  4. <h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h1>
  5. <div class="post_content">
  6. <?php the_content(__('Read more…')); ?>
  7. </div> <!– close post content –>
  8. <div class="post-end-content">
  9. Posted in <?php the_category(', ') ?> | <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?> <?php edit_post_link('Edit','',''); ?>
  10. </div>
  11. </div>
  12. <?php endwhile; else: ?>
  13. Sorry, but you are looking for something that isn‘t here.
  14. <?php endif; ?>
  15. </div>

Report this snippet  

You need to login to post a comment.