• Resolved hdodenhof

    (@hdodenhof)


    Hi all,

    i’m searching for a plugin / hack that makes it possible to show only the latests post instead of the list of recent post on my front page. I know I could configure WordPress to show only one post, but I want to have the single-post-template with comments instead of the “overview”-template. So https://www.myblog.com should look exactly like https://www.myblog.com/2008/1/5/mynewestpost.
    As a quick’n’dirty solution I redirect the request via home.php to the latests post but this is not that nice and not very search-engine-friendly.

    Is there another way to do this? Many thanks in advance for any hint!

Viewing 6 replies - 1 through 6 (of 6 total)
  • I your settings > reading > show at most: 1

    Thread Starter hdodenhof

    (@hdodenhof)

    I know, but as i said:

    I know I could configure WordPress to show only one post, but I want to have the single-post-template with comments instead of the “overview”-template

    Thread Starter hdodenhof

    (@hdodenhof)

    No way to make this possible?

    create a template from one of the standard blog pages and set it to have only one post or use thisd as a starting place and configure as needed

    1)change events to something like home or firstpage etc

    2)where it says cat=11, change it to p=the id of the post you want to show,
    3)save it as someTemplate.php
    4)write/create a page and set the default template, option is on right hand side about half way down, to be the template name you gave it in step 1
    5)set your home page under options; select static page and point it to the page you created in step 4

    <?php
    /*
    Template Name: Events
    */
    ?>

    <?php get_header(); ?>

    <div id=”content” class=”narrowcolumn”>
    <?php
    $query= ‘cat=11’; // concatenate the query
    query_posts($query); // run the query
    $more = 0;
    ?>
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    <?php require(‘post.php’); ?>
    <?php endwhile; ?>

    <div class=”navigation”>
    <div class=”alignleft”><?php posts_nav_link(”,”,’« Previous Entries’) ?></div>
    <div class=”alignright”><?php posts_nav_link(”,’Next Entries »’,”) ?></div>
    </div>

    <?php else : ?>

    <h2 class=”center”>Not Found</h2>
    <p class=”center”><?php _e(“Sorry, but you are looking for something that isn’t here.”); ?></p>
    <?php include (TEMPLATEPATH . “/searchform.php”); ?>

    <?php endif; ?>

    </div>

    <?php get_sidebar(); ?>

    <?php get_footer(); ?>

    Thread Starter hdodenhof

    (@hdodenhof)

    Thank you very much – query_posts did the trick!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Single Post as front page – possible?’ is closed to new replies.