I’m wondering what should be used in index.php (post listing page): the_excerpt()
or the_content()
?
- Twenty Thirteen uses
the_content()
but this prints entire content unless<!--more-->
exists and it completely ignores Excerpt field from [Posts > Add New > Excerpt]. - So, I used
the_excerpt()
instead but this doesn’t react to<!--more-->
tag at all and it just grabs first 55 words or uses manual Excerpt and doesn’t produce “Read more…” link.
What I would like to achieve is this:
- print 55 words
- but react to
<--more-->
- and if manual excerpt is specified, use this instead (most people don’t want the beginning of their post to be their excerpt so this is of crucial importance)
- produce optional “Read more…” link
This looks like the most intuitive to me for post listing pages. Does something like this exist?
If not, should the_content()
be used on post listing pages? I think that most theme users aren’t familiar with <--more-->
tag and they rather expect that themes will create proper excerpts for post listing pages rather than displaying full post content.
Reference:
Your requirements slant towards using
the_excerpt()
with adding read more link by custom code:print 55 words – already this by default and adjustable via
excerpt_length
filterbut react to
<!--more-->
– this already happens, auto-generated excerpt cannot be longer than teaser (part from start of post to<!--more-->
tag)and if manual excerpt is specified, use this instead – already works like this
produce optional “Read more…” link this is one thing excerpt doesn’t do natively. Can be added via:
excerpt_more
filter, note it is only used if post was cutget_the_excerpt
orthe_excerpt
to append to any excerpt