[Resolved] Change excerpt Length and source

Home Forums Support [Resolved] Change excerpt Length and source

Home Forums Support Change excerpt Length and source

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #1604032
    Dave

    I would like to change where the excerpt is drawn from on my blog post page. Currently, I would have to enter an excerpt for each post separately. Is there a way to have it pull from the beginning of the post instead and then just continue into the post?

    cheers,

    Dave

    #1604109
    Leo
    Staff
    Customer Support

    Hi there,

    By default, the auto excerpt should display when the custom excerpt metabox is not in used and there is customizer option for word count:
    https://docs.generatepress.com/article/blog-content-layout/

    Looks like it’s working in this post?
    https://www.screencast.com/t/m4aKYEbT

    #1604116
    Dave

    Thanks Leo, but that is not the excerpt that I am referencing. It is the excerpt that has been created on the post in the Private Information section. It is the single..php.
    I belive the code I am using is drawing specifically from the excerpt and I would like to draw from the actual post.

    cheers,

    Dave

    #1604129
    Leo
    Staff
    Customer Support

    So you are referring to the excerpt in the page hero?

    Are you currently using this snippet here?
    https://docs.generatepress.com/article/page-hero-examples/#example-4

    If so edit the PHP snippet to this:

    function db_page_hero_excerpt() {
        ob_start();
        global $post;
        ?>
        <div class="page-hero-excerpt">
            <?php echo the_excerpt(); ?>
        </div>
        <?php
        return ob_get_clean();
    }
    add_shortcode( 'page_hero_excerpt','db_page_hero_excerpt' );
    #1604150
    Dave

    I am actually wanting to replicate something like this: https://www.saltinourhair.com/tips/start-travel-blog/
    So, maybe I should not be using an excerpt as I don’t think it works in this instance. Any suggestions?

    Cheers,

    Dave

    #1604152
    Leo
    Staff
    Customer Support
    #1604155
    Dave

    Do you have any idea how I would implement them to come up with the desired effect?

    Cheers,

    Dave

    #1604160
    Leo
    Staff
    Customer Support

    Just to make sure, you are referring to this part here?
    01.03.2021-13.12.44

    If so the custom field method I mentioned above should be the way to go.
    https://www.wpbeginner.com/wp-tutorials/wordpress-custom-fields-101-tips-tricks-and-hacks/

    #1604162
    Dave

    That is the section but I think this is way above my limited abilities at the moment πŸ™‚

    I will look for another solution.

    cheers,

    Dave

    #1604167
    Dave

    If I understand this correctly I will have to add it in for each post as it will be different for each one. I have over 500 posts and don’t want to do it for each one πŸ™‚
    Is there another solution?

    cheers,

    Dave

    #1604192
    Leo
    Staff
    Customer Support

    You will only have to add the custom field once in the page hero, but yes each custom field will need to be added within the posts itself.

    There isn’t another solution unfortunately.

    #1604201
    Dave

    Is it possible just to move the featured image to the right and above the sidebar?
    That way the post can continue under the title?

    cheers,

    Dave

    #1604210
    Leo
    Staff
    Customer Support

    Can you open a new topic for the separate question?

    Thanks!

    #1604211
    Dave

    I actually already did πŸ™‚

    Cheers,
    Dave

    #1604217
    Leo
    Staff
    Customer Support

    Thanks!

    We will get to it πŸ™‚

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