groups

name language licence
Untitled Snippet PHP Other
Unique Category template PHP Other
Display Google Ad after the first post PHP Other
Custom Fields PHP Other
Dynamic Content Dynamic Content PHP Other
Unique Single template PHP Other
Query Posts PHP Other
Feature post highlighting PHP Other

< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 >



language: PHP
licence: Other

Query Posts

options: view full snippetsend to code collector
/*You can use query_posts to control which posts to show up in The Loop. It allows you to control what content to display, where to display, and how to display it. You can query or exclude specific categories, so you get full control of it. Here I will show you how to use query_posts to display a list of Latest Posts, Feature Posts, and how to exclude specific category.
*/

/*Display Latest Posts*/

<?php query_posts('showposts=5'); ?>

<ul>
  <?php while (have_posts()) : the_post(); ?>
  <li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
  <?php endwhile;?>
</ul>

/*Display Feature Posts*/

	
(Continues...)