[Resolved] show featured image depending on the category post

Home Forums Support [Resolved] show featured image depending on the category post

Home Forums Support show featured image depending on the category post

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #679908
    Liberty

    Hello,

    I want to customise a bit some category page and i wonder if it’s possible to hide/show the featured image depending on the category ?

    Thank you for this great theme πŸ™‚

    #680335
    Leo
    Staff
    Customer Support

    Hi there,

    You can use this filter:
    https://docs.generatepress.com/article/option_generate_blog_settings/

    So the code would be something like this:

    add_filter( 'option_generate_blog_settings', 'lh_hide_category_featured_image' );
    function lh_hide_category_featured_image( $options ) {
        if ( is_category( 'my-category' )  ) {
    	$options['post_image'] = true;
        }
      
        return $options;
    }

    Adding PHP: https://docs.generatepress.com/article/adding-php/

    Let me know πŸ™‚

    #680357
    Liberty

    Perfect, thank you =)

    #680398
    Leo
    Staff
    Customer Support

    No problem πŸ™‚

    #680837
    Liberty

    Leo,

    I was browsing the option but i don’t find the one that allow the content type to be ‘full content’ instead of excerpt (http://prntscr.com/kw3p8z).

    Is it a mistake on the doc or is this option unavaible ?

    Thank you

    #681647
    Leo
    Staff
    Customer Support

    The excerpt length is actually handled by WordPress itself so it has the WordPress filter instead:
    https://docs.generatepress.com/article/generate_show_excerpt/

    Let me know if this helps πŸ™‚

    #681832
    Liberty

    Perfect, thank you again !

    #682327
    Leo
    Staff
    Customer Support

    No problem πŸ™‚

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