WordPress.org

Ready to get started?Download WordPress

Forums

Showing only 1 post? (2 posts)

  1. armstrong1118
    Member
    Posted 6 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
    Member
    Posted 6 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>

    <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>'); ?>

    </div>
    </div>

    <?php endwhile; else: ?>

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

    <?php endif; ?>

    </div>

    <?php get_sidebar(); ?>

    <?php get_footer(); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.