Site logo

Archived topic

Custom Post Type - Make Image Go Above the Title for a Custom Post Type

3 replies · Started by Paul on June 18, 2017

Viewing posts 1–4 of 4

Hi there,

1.) On the Blog Page for the Custom Post Type "review", I'm trying to get the featured image to go above the title and then have it float to the right like I've done on the Single Post Page:

This is what I want the Blog Page to look like:

The featured image is above the title.

2.) Once the featured image is above the title, I'd need to get the image to float to the right. I'm guessing this can be done easily with CSS?

Thanks heaps

Paul

Hi Paul,

Looks like it's working on the page you linked to.

To do this on the actual blog page, you can set it in Customize > Blog > Featured Images (set to above title, float right).

Or are you wanting this only to happen on this specific post type and not other post types?

Its working on the page I linked to but not:

Yeah I'm after it for only the Specific Post Type "Review"

Thanks heaps

Paul

Try this:

add_filter( 'option_generate_blog_settings','tu_cpt_featured_image_location' );
function tu_cpt_featured_image_location( $options ) {
	
	if ( 'review' == get_post_type() || is_post_type_archive( 'review' ) ) {
		$options[ 'post_image_position' ] = 'post-image-above-header';
		$options[ 'post_image_alignment' ] = 'post-image-aligned-right';
	}
	
	return $options;
}
This archived topic is closed to new replies.