Create Custom Featured Articles with WordPress loops

Advertisements

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.

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();

Share please!

Some of the links on this site are affiliate links. This means if you click on the link and purchase the item, I will receive an affiliate commission.

Leave a Reply