[Resolved] Show the excerpt for every categories but one

Home Forums Support [Resolved] Show the excerpt for every categories but one

Home Forums Support Show the excerpt for every categories but one

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1397815
    Suresh

    Hi,

    I am trying to add a filter (as suggested on this post: https://generatepress.com/forums/topic/full-length-posts-for-1-category-else-excerpt-only/).

    I am using the following code within the “Code snippet” plugin as php:

    add_filter( 'generate_show_excerpt','tu_full_post_photos' );
    function tu_full_post_photos( $show_excerpt ) {
        if ( is_category( 'Deals' ) ) {
    		return false;
    	}
    	return $show_excerpt;
    }

    I am not sure why is not working, am I doing anything wrong?

    #1397831
    Leo
    Staff
    Customer Support

    Hi there,

    Can you link me to the deals category page?

    The page you’ve linked is just the default posts page.

    #1397835
    Suresh

    I haven’t any page dedicated for just the deals category. I have added the link to the first post with one of the post that has category = deals.

    #1397846
    Leo
    Staff
    Customer Support

    Little confused.

    The page you link now is a single post?

    #1397854
    Suresh

    Sorry Leo, I think I’m making you crazy tonight ๐Ÿ˜€

    So basically I have two types of post categories, Deals and Guide. When I go to the default post page, I would like to have the “Deals” posts to show in full, but the “Guide” posts to show only the excerpts.

    Does it make sense?

    #1397926
    Leo
    Staff
    Customer Support

    Hmm can you try if in_category works?
    https://codex.wordpress.org/Conditional_Tags#A_Category_Page

    #1398447
    Suresh

    Thank you Leo, the in_category is working good!

    #1399145
    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.