The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Showing only 1 post? (2 posts)

  1. armstrong1118
    Posted 8 years ago #

    I want to change the way my archive pages act. I want to change it so that when you access the archive page it automatically shows you an assigned post.

    I managed to make the archive page show the posts like they appear in single.php (pretty much because I copied and pasted) but it currently shows all of the posts.

    Is there something I can do to show just one post/and assign it to be a certain post, not like the most recent?

  2. armstrong1118
    Posted 8 years ago #

    by the way, here is the code im using.

    <?php get_header(); ?>

    <div id="content" class="narrowcolumn">

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    <div class="navigation">
    <div class="alignleft"></div>
    <div class="alignright"></div>

    <div class="post" id="post-<?php the_ID(); ?>">
    <h2>" rel="bookmark" title="Permanent Link: <?php the_title_attribute(); ?>"><?php the_title(); ?></h2>

    <div class="entry">
    <small><class="postmetadata"><?php the_tags('Tags: ', ', ', '
    '); ?> Filed under: <?php the_category(', ') ?></small>
    <?php the_content('<p class="serif">Read the rest of this entry »</p>'); ?>

    <?php wp_link_pages(array('before' => '<p>Pages: ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    <?php the_tags( '<p>Tags: ', ', ', '</p>'); ?>


    <?php endwhile; else: ?>

    <p>Sorry, no posts matched your criteria.</p>

    <?php endif; ?>


    <?php get_sidebar(); ?>

    <?php get_footer(); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.