Forums

Where to place a query to show only one post (2 posts)

  1. WMS Group
    Member
    Posted 2 years ago #

    I cannot seem to figure out where to place the query to show only one post in my home.php file. The template I am using uses this file for the home page. Here is the code:

    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    <div class="fullbox" id="post-<?php the_ID(); ?>">
    <h3><?php the_category(', ') ?></h3>
    <div class="fullbox_content">
    <h1><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h1>

    Any help would be appreciated!

  2. alchymyth
    The Sweeper
    Posted 2 years ago #

    right infront of your code:

    <?php global $query_string;
    query_posts($query_string . "&posts_per_page=1"); ?>
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    //and so on//

Topic Closed

This topic has been closed to new replies.

About this Topic