Create Custom Featured Articles with WordPress loops

WordPress loops is one of the simplest ways to create custom featured articles . Custom loops will make the process simple as pie. The code below, for example, will pull articles only from the featured category. You can update this to include whatever you’d use.

[php]
query_posts(‘showposts=5&category_name=featured’);
if ( have_posts() ) : while ( have_posts() ) : the_post();
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<p><?php the_content(); ?></p>
endwhile; else:
endif;
wp_reset_query();
[/php]

Recommended For You

About the Author: staff

Leave a Reply

Your email address will not be published. Required fields are marked *