Site logo

Archived topic

How to display the featured image below the title?

23 replies · Started by rtomc on May 12, 2015

Viewing posts 1–15 of 24

Hi,

How to display the featured image below the title in single post?

Thanks.

rtomc

Using the Page Header add-on, go to "Appearance > Customize > Page Header".

Then set the "Single Post Header Position" to "Below Title".

As simple as that! many thanks!

You're welcome :)

Is there a way to change this post by post? For one of my categories (category-3), I want the Single Post Header Location to be Above Content Area, but in the rest I want it Inside Content Area.

You could try this:

add_filter( 'option_generate_page_header_settings','tu_dynamic_page_header_position' );
add_filter( 'option_generate_blog_settings','tu_dynamic_page_header_position' );
function tu_dynamic_page_header_position( $options ) {
	
	if ( in_category( 'category-3' ) ) {
		$options[ 'post_header_position' ] = 'above-content';
	}
	
	return $options;
}

Adding PHP: https://docs.generatepress.com/article/adding-php/

Thanks! I'll try it.

Btw, Does the "dynamic" part mean that the non-Category-3 posts will match whatever I set in my customizer for Featured images?

I added it in Code Snippets, cleared my caches and Cloudflare, and used incognito, but it doesn't seem to work.

How it looks:

How I want it to look:

how i want it to look

The header is actually always the same in these posts, so if it's easier to write it that way (to always put the same header on top of these posts), that works for me too.

Can you link me to the post in question?

What's the exact code you're using?

I pasted in the code you gave me in Code Snippets. I have the featured image set as the page header using the checkboxes that appear on the editing page after activating that option in GP.

You'll need to change category-3 to the name of your category: chechnya

Ah. Thank you. I'm a newbie at PHP, and apparently this is another of the many things that makes PHP different from CSS. Neat!

And it works now. :)

Glad I could help :)

This archived topic is closed to new replies.