Site logo

[Support request] Display manual excerpt in a blog post

Home Forums Support [Support request] Display manual excerpt in a blog post

Home Forums Support Display manual excerpt in a blog post

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2442817
    Quentin

    Hello

    I would like to display the manual excerpts of my blog posts, in my blog posts (for example above the Title of the post) but I can’t find the option in Customize>Layout>Blog (there are options for the excerpt only for archive, not for single posts).

    Here is one of the blog posts : https://staging-darwinnutritionfr-dev.kinsta.cloud/meilleurs-enzymes-digestives/

    I have no “read more” in this post
    The only plugins I have are Generatepress, Generatepress Premium, Yoast and WP show post.

    Thanks for you help

    Quentin

    #2443036
    David
    Staff
    Customer Support

    Hi there,

    Excerpts are only displayed in the archives by default.
    If you want o display just the Manual ( not auto ) excerpt on the single post before the title, then add this PHP Snippet to your site:

    
    add_action('generate_before_entry_title', function(){
        if ( is_single() && has_excerpt() ) {
            ?>
            <span class="entry-subtitle"><?php echo get_the_excerpt(); ?></span>
            <?php
        }
    });

    How to add PHP:
    https://docs.generatepress.com/article/adding-php/

    #2443596
    Quentin

    It works, thank you !

    #2444260
    David
    Staff
    Customer Support

    Glad to hear that!

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