I've been given a design for a WordPress site which will be mostly made up of pages rather than posts. However, at the top of each page there needs to be three featured items in a row. Each featured item will have an image, title, a small bit of summary text, and a link to another page.

Can anyone tell me the best way of implementing these featured items for a page? Would they need to be a custom content type? And if so how would I implement it in the template? They need to be fairly easy for administrators to edit, and change, and link to other pages.

I am an experienced Drupal designer, but am new to WordPress.

Any help would be much appreciated.


  • The right solution depends entirely on the purpose of the featured items? What criteria determines what they are (selected arbitrarily? by date? taxonomy? something else?).
    – mrwweb
    Jul 7, 2012 at 20:42
  • Hi mrwweb, the featured items are a way of highlighting different pages for a section of the website. So each section of the website could highlight pages within that section. The featured items would generally be fixed but could be changed by administrators.
    – Ben
    Jul 12, 2012 at 12:47

1 Answer 1


Since I don't know the complete scope of the project I can only give a suggestion on what I would do.

Since you will be using a page for placing the 3 images with title and excerpt, I'd create a custom page template that has two loops. The first loop would use query_posts to bring in the 3 images (title, and excerpt). I would then use a second loop to show the content of the page.

The part that would need some planning would be how to set up the first loop. If the 3 featured items can be randomly chosen from a given category you can simply use query_posts to retrieve the posts. If not it will be a little bit more work.

If you have several different pages that will use this structure it would be best to use conditional tags so you won't have to make a custom page for each category. I've put together a sample custom page to show you what I'm talking about. I haven't tested it live, but I believe the code is correct. In the example I'm using 3 posts with a custom image and the excerpt for a brief bit of text from category 8 being the id. I've commented the code to explain some of the code:

Template Name: Featured
<?php get_header(); ?>
<div class="inner">

<?php /** Use WP_Query instead of query_posts, Thanks to Chris_O for the heads up */ ?>

    $custom_query = new WP_Query( 'posts_per_page=3&cat=8' );
    while ( $custom_query->have_posts() ) : $custom_query->the_post(); 
    <div class="featured">
        * Here is where you bring in the 3 post from the category
        * (with the id of 8 for this example)
      <a href="<?php the_permalink(); //Makes the image Link to the Full Post ?>">
      <?php the_post_thumbnail(); // Gets The Posts Thumnail ?></a>
        <a href="<?php the_permalink(); //Gets the Title/Link to the post ?>">
        <?php the_title(); ?></a>
      <?php the_excerpt(); // The excerpt can be customized for amount of text displayed ?>

  <?php endwhile; ?>  
  <?php wp_reset_query(); ?>

    <div class="wrapper">
      <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
      <div class="entry">
        <h2><?php the_title(); ?></h2>
        <?php the_content(); ?>
        <p class="postmetadata">Posted in <?php the_category(', ') ?> <strong>|</strong>
          <?php edit_post_link( 'Edit','','<strong>|</strong>' ); ?>
          <?php comments_popup_link( 'No Comments &#x27A6;', '1 Comment &#x27A6;', '% Comments &#x27A6;' ); ?>
      </div><!-- End Entry -->
      <?php endwhile; ?>

  <?php else : ?>
    <h2 class="center">Not Found</h2>
    <p class="center">Sorry, but you are looking for something that isn't here.</p>
  <?php endif; ?>

</div><!-- END POST -->

<?php get_sidebar(); ?>
<?php get_footer(); ?>

Let me know if you need more help.

EDITED: Changed the code to use WP_Query per Chris_O's advice.

  • I would recommend doing a new WP_Query instead of using query_posts. See wordpress.stackexchange.com/a/1755/251 for more info.
    – Chris_O
    Jul 8, 2012 at 7:52
  • I've updated the code as advised. Thanks for taking the time to point it out, I appreciate the link and advice, regards Jul 8, 2012 at 9:37
  • Hi Jeremy Jared, thank you very much for taking the time to answer my query and for your example. It is very helpful, especially as I am new to Wordpress. It is also helpful in showing me the approach to take to solve my problem.
    – Ben
    Jul 12, 2012 at 12:44
  • @Ben I'm glad it was useful. One of the benefits of wordpress.stackexchange.com is the ability to learn as you try to help others as I did in this question. Jul 12, 2012 at 12:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.