[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 15 posts - 1 through 15 (of 24 total)
  • Author
    Posts
  • #107369
    rtomc

    Hi,

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

    Thanks.

    rtomc

    #107417
    Tom
    Lead Developer
    Lead Developer

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

    Then set the “Single Post Header Position” to “Below Title”.

    #215006
    Raymundo Ycaza

    As simple as that! many thanks!

    #215049
    Tom
    Lead Developer
    Lead Developer

    You’re welcome πŸ™‚

    #326598
    dale

    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.

    #326671
    Tom
    Lead Developer
    Lead Developer

    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/

    #326725
    dale

    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?

    #326822
    dale

    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.

    #326886
    Tom
    Lead Developer
    Lead Developer

    Can you link me to the post in question?

    #326904
    dale
    #327024
    Tom
    Lead Developer
    Lead Developer

    What’s the exact code you’re using?

    #327153
    dale

    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.

    #327259
    Tom
    Lead Developer
    Lead Developer

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

    #327342
    dale

    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. πŸ™‚

    #327479
    Tom
    Lead Developer
    Lead Developer

    Glad I could help πŸ™‚

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