Black Friday Sale! Get up to $40 off GP Premium!Learn more

Reply To: Header on Home Page Showing List of Latest Posts

Home Forums Support Header on Home Page Showing List of Latest Posts Reply To: Header on Home Page Showing List of Latest Posts

#188246
Tom
Lead Developer
Lead Developer

Hi Anis,

It’s tough on the blog page as WordPress doesn’t offer any way to do it like they do on static pages (using the Featured Image metabox).

It’s possible with some PHP though:

add_action( 'generate_after_header','generate_blog_header_image' );
function generate_blog_header_image()
{
    if ( ! is_home() )
        return;
    ?>
    <div class="page-header-image grid-container grid-parent generate-page-header">
        <img src="URL TO YOUR IMAGE" alt="" />
    </div>
    <?php
}

Adding PHP: https://generatepress.com/knowledgebase/adding-php-functions/

Of course the Page Header add-on allows you to do this and way more in the Customizer 🙂