[Resolved] Page header fix no longer working

Home Forums Support [Resolved] Page header fix no longer working

Home Forums Support Page header fix no longer working

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #420172
    dale

    Not sure if this happened with the latest update or a previous one, but in any case, the solution provided in this discussion for having the page header full width across the page (content area and sidebar) no longer works: https://generatepress.com/forums/topic/category-image-header-broke-with-latest-update/

    Alternatives?

    #420181
    Tom
    Lead Developer
    Lead Developer

    Hi Dale,

    Very strange – looks like you just need to set your “post” featured image to above the content area. Go to “Customize > Layout > Blog” and you should see the Featured Image options πŸ™‚

    #420780
    dale

    OK. But I don’t want that, because that would affect all the featured image on the posts on the site. I only want this to affect the page headers in this category.

    #420809
    Benjamin

    Page header is not working well

    #420888
    Leo
    Staff
    Customer Support

    Hi Benjamin,

    Can you open a new topic and explain a bit more what’s not working well?

    #420922
    Tom
    Lead Developer
    Lead Developer

    Hmm, unless you had custom PHP to move the featured image in that one category before, it would affected all posts on your site anyways.

    Now, you can do this:

    add_filter( 'option_generate_blog_settings', 'tu_category_featured_image_position' );
    function tu_category_featured_image_position( $options ) {
        if ( in_category( 'chechnya' ) ) {
            $options['single_post_image_position'] = 'above-content';
        }
    
        return $options;
    }
    #420943
    Benjamin

    Hi,

    I’m sorry I did not read this part “Content is required for the below settings to work.”
    It would be good if you could place a background without content and allow to change the color of the menu

    Thanks!

    #420951
    dale

    Oh! I do have PHP. Sorry. I forgot about that part. It’s

    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( 'chechnya' ) ) {
    		$options[ 'post_header_position' ] = 'above-content';
    	}
    	
    	return $options;
    }

    Should I go ahead and try replacing this with what Tom mentioned above?

    #420952
    Tom
    Lead Developer
    Lead Developer

    Yea, replacing that function should fix it πŸ™‚

    #420959
    dale

    Thanks! It is fixed!

    #420961
    Tom
    Lead Developer
    Lead Developer

    You’re welcome! πŸ™‚

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