• My understanding based on the Codex was that the_excerpt() pulls the data field “excerpt” (aka “manual excerpt”) from a post or a page if it exists, and failing that, will pull the first 55 words from the post/page and auto-generate the content, removing the HTML while it does so.

    For some of my pages (pages, not posts… I had to enable it in 3.1 specifically in functions.php), I have short excerpts (2 words only) because I want extremely summarized information showing up as the excerpt.

    The issue is — the content returned by the_excerpt() is the manual excerpt PLUS auto-generated content and the result of (manual + auto) is a 55-word block.

    I don’t want WordPress concatenating the two – I want WordPress to honor the manual excerpt, regardless of size.

    Can anyone shed any light on if this is intended behavior, if it changed, or if I should do anything other than look through the actual code?

Viewing 1 replies (of 1 total)
  • In default WordPress excerpts don’t exist for pages, only for posts.

    There may be plugins or code changes that will add the excerpt box to pages. They may not work as expected when displaying the pages.

    To test if this is the problem, create a post that has the same content as the page and create the same custom excerpt. Then display that post using a template that displays post excerpts. If the excerpt works as expected with the post then you know something is not complete with the code you are using to add excerpts to pages.

    Rather than using excerpts on pages you could make pseudo-excerpts by putting the summary text in a custom field – call the custom field “Excerpt” if you like. Modify the page.php theme to look for a custom field called Excerpt. If it exists, display the excerpt, if not display the full page content. You can also use the editor’s More tag on pages and create a “read more” link on that page.

Viewing 1 replies (of 1 total)
  • The topic ‘Issues with short excerpts: the_excerpt() still pulling from post’ is closed to new replies.