• looking to take a current theme, and create a unique home page for the 1 newest post, then have all old posts on another page.

    I have been able to create the custom home page using:

    <?php
    query_posts('pagename=home');
    ?>

    Is there a way I can have the newest single post here instead of page content?

    also how would I create a page for all other posts (besides archives)?

    thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter factor1studios

    (@factor1studios)

    update: I read on codex not to call my custom home file “home.php” Changing this name allows me to edit the reading option to have this static home, and have “blog” page to display all blog posts.

    Now all i really need is a was to display that single most resent post on my “homepage.php” home file.

    you can still using standards template (index.php) and follow these steps :

    1. search for this line <? query_posts(); ?> in the index of your template
    2. replace with <? query_posts(‘showposts=1’); ?>
    3. finish

    if you’d like to using homepage.php instead index.php, copy code below t your homepage.php

    <? query_posts(‘showposts=1’); ?>
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>

    <div class=”post” id=”post-<?php the_ID(); ?>”>
    <h2>” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”><?php the_title(); ?></h2>
    <small><?php the_time(‘F jS, Y’) ?> <!– by <?php the_author() ?> –></small>

    <div class=”entry”>
    <?php the_content(‘Read the rest of this entry »’); ?>
    </div>

    <p class=”postmetadata”><?php the_tags(‘Tags: ‘, ‘, ‘, ‘
    ‘); ?> Posted in <?php the_category(‘, ‘) ?> | <?php edit_post_link(‘Edit’, ”, ‘ | ‘); ?> <?php comments_popup_link(‘No Comments »’, ‘1 Comment »’, ‘% Comments »’); ?></p>
    </div>

    <?php endwhile; endif ?>

    Thread Starter factor1studios

    (@factor1studios)

    Thanks. That makes sense.

    Any idea how to get my homepage.php not to show page content? Right now, even with this new code, its still reading a a standard page.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘custom single post home, with page for past posts’ is closed to new replies.