WordPress.org

Support

Support » How-To and Troubleshooting » How to add latest post to bottom of static homepage?

How to add latest post to bottom of static homepage?

  • I created a static homepage for my WordPress site. Now, I want to put the latest/most recent blog post at the bottom of the homepage. I looked this up online and found one solution, but the problem is that it put the latest blog post on the bottom of every static page. Does anyone know how I can have the latest blog post show up at the bottom of just the homepage?

    I am using the Inove theme.

    Thanks,
    Tom

Viewing 3 replies - 1 through 3 (of 3 total)
  • esmi

    @esmi

    Forum Moderator

    You could use the is_front_page() conditional:

    <?php if( is_front_page() ) :?>
    [ latest/most recent blog post code ]
    <?php endif;?>

    Or you could look at creating a custom page template for your front page.

    I tried adding that code to my page.php page, but it gave me an error. Here is the code that I tried:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    I wasn’t adding the second ‘<?php endif;?>’ to the end of the code. I added it and it works like a charm! Thanks esmi!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to add latest post to bottom of static homepage?’ is closed to new replies.