WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to start a funny images website but I have come across a dilemma. I want the website to display 1 post ( not the thumbnail) but the full post on the home page. (the most recent post). Similar to jokideo can anyone please direct me to a theme or provide some code that I need to edit in the wp theme files.

Thanks :)

share|improve this question
You can do this using a page and set that page as a Homepage. Use a custom query for fetching the first post and use a loop to display the post content. – Rohit Pande Mar 26 '13 at 6:57

It depends on what theme you use as they are not coded the same.

Use pre_get_posts or the reading settings and the_content() rather than the_excerpt() in your loop.

function wpsites_home_page_limit( $query ) {
    if ( $query->is_home() && $query->is_main_query() && !is_admin() ) {
        $query->set( 'posts_per_page', '1' );
add_action( 'pre_get_posts', 'wpsites_home_page_limit' );

Or you could redirect the latest single post to display on the home page.

share|improve this answer

Create a page template with this code between header and footer:

 * Template Name: The Last Post

//The code begins here

$the_query = new WP_Query( 'posts_per_page=1' ); 

while ($the_query -> have_posts()) : $the_query -> the_post(); ?>
    <a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
    <?php the_content();

//The code ends here

get_footer(); ?>

Then create a new page, select this template and save it. Now in Settings > Reading, select the option "static page" and define the page created as "Front page".

Also, create a new white page with the blog name —for example— and save it. In Settings > Reading, define this page as "Posts page". Now we have the last post in the front page and all the posts in a blog page.

But we still need to exclude the last post in the loop, in order to avoid duplicate content. You will probably find the loop in the file index.php or loop.php.

Find this line:

if ( have_posts() ) : while ( have_posts() ) : the_post();

And add these lines overriding the last one:

$offset = new WP_Query( 'offset=1' ); 
if ( have_posts() ) : while ($offset -> have_posts() ) : $offset -> the_post();
share|improve this answer
Just a few pointers here, showposts is depreciated, was replaced with posts_per_page. And NEVER use query_posts. Rather use WP_Query, get_posts or use pre_get_posts – Pieter Goosen Jul 27 '14 at 3:54
Good to know that, Pieter. This afternoon when I'm back I will update my answer. Thank you. – Gerard Jul 27 '14 at 8:45
Updated. I hope it is better now. – Gerard Jul 27 '14 at 22:46

I would recommend altering the loop that displays the home page posts. Something like

<?php /* Start the Loop */ 
        while ( have_posts() ) {


            if($i === 0){
                get_template_part( 'content', get_post_format() );

There probably are better and more elegant solutions to this, but this is quite simple to implement.

You can edit the file responsible for displaying front page posts (index.php in the twentytwelve theme ), but I wouldn't recommend this seeing that it might be overwritten when updating. It will be better to use a custom theme, maybe a child theme, or to use a custom template file for the front page

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.