Site logo

Archived topic

Custom post header with featured image

3 replies · Started by Marc on July 16, 2020

Viewing posts 1–4 of 4

I'm trying to create a custom post header similar to the wirecutter layout: https://www.nytimes.com/wirecutter/reviews/best-wired-wireless-gaming-mouse/

All I'm really trying to do is get the title above the container which holds the sidebar and content area. So the featured image on top, title below, then the sidebar/content areas.

I tried playing around with custom headers but I don't want the featured image to be a background.

What's the best way to go about this?

Thanks

Hi there,

What if you built a Header Element, but included the featured image in the content instead of using it as a background?

You can output the featured image with this template tag: {{custom_field.thumbnail_id}}

By default it will output the "medium" size image. You can change that like this:

add_filter( 'generate_hero_thumbnail_id_size', function() {
    return 'large';
} );

Let me know :)

Tom saves the day again! ha. I didn't know there was a tag for the featured image. That should work. Thanks!

No problem! :)

This archived topic is closed to new replies.