Site logo

Archived topic

How to display the featured image below the title?

23 replies · Started by rtomc on May 12, 2015

Viewing posts 16–24 of 24

Hi there,

I need the same thing as above but for a custom post type called "review".

The code above:

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;
}

Thanks heaps

Paul

You would do 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 ( 'review' == get_post_type() ) {
		$options[ 'post_header_position' ] = 'above-content';
	}
	
	return $options;
}

Does this work on a Single Post as well or just on the archive pages.

It's not working on a single post.

Thanks heaps

It will work as long as "review" is the exact name of the post type you're currently viewing, which includes single posts. Can you link me to the post in question?

It doesn't seem to be working on this post

That code adds the header above the content, which it does on that page.

Where do you want it to display?

I'm trying to get the featured image below the title for that custom post type in both those custom post archives and single post, i must have mis-communicated.

Worked it out, thanks

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 ( 'review' == get_post_type() ) {
		$options[ 'post_header_position' ] = 'below-title';
	}
	
	return $options;
}

Perfect :)

This archived topic is closed to new replies.