[Resolved] How to display the featured image below the title?

Home Forums Support [Resolved] How to display the featured image below the title?

Home Forums Support How to display the featured image below the title?

Viewing 9 posts - 16 through 24 (of 24 total)
  • Author
    Posts
  • #334275
    Paul

    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

    #334308
    Tom
    Lead Developer
    Lead Developer

    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;
    }
    #334314
    Paul

    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

    #334547
    Tom
    Lead Developer
    Lead Developer

    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?

    #334831
    Paul

    It doesn’t seem to be working on this post

    #334838
    Tom
    Lead Developer
    Lead Developer

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

    Where do you want it to display?

    #334846
    Paul

    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.

    #334857
    Paul

    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;
    }
    #334986
    Tom
    Lead Developer
    Lead Developer

    Perfect 🙂

Viewing 9 posts - 16 through 24 (of 24 total)
  • You must be logged in to reply to this topic.