Support » Fixing WordPress » Display current post on homepage

  • I trying to get the most recent post to display on my homepage. Only the most recent post, in plain letters with no sidebars or anything like that.

    Can anyone help me.


Viewing 8 replies - 1 through 8 (of 8 total)
  • if you JUST want it on your homepage, you can create a home.php template, and simple simple code, using query_posts to limit the display to one entry.

    try this in a new file named home.php, and upload to your themes folder.

    <?php get_header(); ?>

    <?php query_posts('showposts=1'); ?>

    <?php if (have_posts()) : ?>

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

    <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>

    <small><?php the_time('F jS, Y') ?> </small>

    <?php the_content('Read the rest of this entry &raquo;'); ?>

    <?php endwhile; ?>

    <?php else : ?>

    <?php endif; ?>

    `<?php get_footer(); ?>

    more perams for query_posts:

    i also found this on the codex, which offers another solution. so that you can eliminate the header. check this out:

    try both!

    I tried creating the home.php file, put it in the themes folder. Now what???

    Tried the first link you gave me couldnt get that to work. Iam really inexperianced with .php.

    I really appreciate your help.

    You need to give us more info – and, eventually, a link to your site.
    Is the “homepage” part of the WP? the solution suggested above is for that case.
    Is the homepage at the root? In another directory? Is it a php file or html? Will there be anything else on the homepage or only the most recent post?
    Help us to help you 🙂

    Here is a link to my church’s site which i run. Iam currently working on changing the theme.

    I’ve put a little message “Put WORD PRess here”
    Were i want the posts to appear.

    Sorry i wasnt more clear on what i wanted.


    If the main page of your site is going to be an .html file, then you should probably look for a feedreader (e.g. from this CG Powerpack I guess it works on HTML pages, too.

    Well i could change the extenstion woundnt matter. I just need to make it work.

    What would i have to change it to??

    In .php pages it works for sure!
    However, if you can change it to .php then you have more choices:
    a. you can just include The_Loop in your homepage
    b. you can use this tutorial:
    c. you can use a recent_post plugin
    For all the cases see the tutorial how to make your .php file “WP aware”.

    (noroc şi sănătate)

    I dont understand half of what those tutorials are saying, i thought there be a lot simplier way to do this???

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Display current post on homepage’ is closed to new replies.