Site logo

[Resolved] ‘generate_blog_single_featured_image’ for page not only post

Home Forums Support [Resolved] ‘generate_blog_single_featured_image’ for page not only post

Home Forums Support ‘generate_blog_single_featured_image’ for page not only post

  • This topic has 9 replies, 3 voices, and was last updated 5 years ago by Leo.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1430662
    Jean

    Hi there,

    I tried to remove featured image inside inside-articletag. On single page it work’s with :
    remove_action('generate_before_content', 'generate_blog_single_featured_image')

    How do I do the same for page please ?

    Thanks

    #1430686
    David
    Staff
    Customer Support

    Hi there,

    you don’t need to use that Snippet.
    Instead do this:

    1. In Appearance > GeneratePress enable the Disable Elements and Elements modules
    2. In Appearance > Elements create a new Layout Element
    Disable the Featured Image
    And set the Display Rules Location: Posts > all posts and Pages > All pages.

    https://docs.generatepress.com/article/layout-element-overview/

    #1430697
    Jean

    Hi,
    thanks for quick answer.
    I prefer to do that with hooks and filer since the end user can’t change theese settings.
    Are you sure it’s not possible ?

    Thanks again,

    #1430896
    David
    Staff
    Customer Support

    Try this:

    remove_action( 'generate_before_content', 'generate_featured_page_header_inside_single', 10 );

    #1430918
    Jean

    Sorry but doesn’t works (I tried)

    #1430923
    Leo
    Staff
    Customer Support

    What is your featured image location setting for pages?

    #1430929
    Jean

    On top of title, for page and posts

    #1430980
    Leo
    Staff
    Customer Support

    Just to make sure, you don’t want to use the customizer option either?
    https://docs.generatepress.com/article/adjusting-the-featured-images/

    If so try this:

    add_filter( 'option_generate_blog_settings', function( $options ) {
            $options['page_post_image'] = false;
    
        return $options;
    } );
    #1433515
    Jean

    Hi Leo,

    Sorry for the long response time, I was very busy with the rest of the project.
    Indeed, I prefer to use hooks and functions. 🙂
    Thanks for this one.
    Your support is really efficient!
    See you soon,

    #1433833
    Leo
    Staff
    Customer Support

    No problem 🙂

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