Get Appointment

    How to Display Recent Blog Posts on WordPress Homepage

    Displaying recent blog posts on your WordPress homepage can be done in multiple ways, depending on your theme and customization preferences. Here are some methods:


    1. Use WordPress Settings (Default Method)

    1. Log in to your WordPress dashboard.

    2. Go to Settings > Reading.

    3. Under Your homepage displays, select Your latest posts.

    4. Save the changes.

    This method automatically shows recent blog posts on your homepage.


    2. Use the Latest Posts Block (Gutenberg Editor)

    1. Go to Pages > Add New (or edit an existing homepage).

    2. Click the “+” button to add a new block.

    3. Search for Latest Posts and add the block.

    4. Customize the display settings (like post count, order, and excerpt).

    5. Publish or update the page.


    3. Use WordPress Widgets (For Sidebar or Homepage Sections)

    1. Go to Appearance > Widgets.

    2. Look for the Latest Posts widget.

    3. Drag and drop it into the desired widget area (e.g., sidebar, footer, homepage section).

    4. Configure the settings (like number of posts to display).

    5. Save changes.


    4. Use a Page Builder (Elementor, Divi, etc.)

    If you’re using Elementor or another page builder:

    1. Edit your homepage with Elementor.

    2. Add a Posts widget (Elementor’s “Posts” or “Recent Posts”).

    3. Customize the layout, grid, and styling.

    4. Save and publish the page.


    5. Use Custom Code (For Developers)

    If your theme doesn’t support displaying posts, you can add custom PHP code.

    • Edit your theme’s home.php or front-page.php file.

    • Insert this PHP snippet:

    php

    <?php
    $args = array(
    ‘posts_per_page’ => 5, // Number of posts to display
    );
    $query = new WP_Query($args);
    if ($query->have_posts()) :
    while ($query->have_posts()) : $query->the_post(); ?>
    <h2><a href=”<?php the_permalink(); ?>”><?php the_title(); ?></a></h2>
    <p><?php the_excerpt(); ?></p>
    <?php endwhile;
    wp_reset_postdata();
    endif;
    ?>

    • Save the file and refresh your homepage.

    Let’s Design Your New Website

    Do you want to have a website that stands out and impresses your clients? Then we are ready to help! Click the button below to contact us and discuss your ideas.