Skip to content

Do not want excerpt to auto-generate if empty #62

@simonrjones

Description

@simonrjones

Currently {{ page.excerpt }} returns the first line of content if it is empty in WordPress. This is not desired on the template Sean is working on.

Ideally this would behave like so:

  • Output the actual content that exists (even if empty)
  • Give the user the option to auto-generate but do not make this default
    public function getExcerpt(int $limit = 200): string
    {
        if (empty($this->excerpt)) {
            return $this->trimContent($this->__toString(), $limit);
        }

        return $this->excerpt;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions