• I would like to add one specific post to the main page under the featured post section. How do I call just one specific post (ID=63)?

    Here is the code as it is now:

    <div id=”content”>
    <?php if(is_home()) { include (TEMPLATEPATH . ‘/featured.php’); } ?>
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    <div <?php post_class() ?> id=”post-<?php the_ID(); ?>”>

    Any help would be appreciated. Thanks!

Viewing 1 replies (of 1 total)
  • This may work for you:

    <?php query_posts( 'p=63&posts_per_page=1' ); ?>
    <div id="content">
    <?php if(is_home()) { include (TEMPLATEPATH . '/featured.php'); } ?>
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
    ...
    <?php wp_reset_query(); ?>

    The query_posts() call will pull post with ID 63 and although not necessary it restricts the posts to one per page as well. The ‘reset’ at the end just insures you are not stomping on any other queries that follow this code (just put it right after the end of the_Loop for this single post).

Viewing 1 replies (of 1 total)
  • The topic ‘Remove Loop to Show One Specific Post on Main Page’ is closed to new replies.