parameter 'stripteaser' of get_the_content does not work as expected
|Reported by:||makibo||Owned by:|
|Component:||Template||Keywords:||has-patch, stripteaser, the_content, more, early|
let's imagine this case:
On a wordpress site some posts got the more-Tag, some don't.
The content before the more-Tag is called "teaser", the rest is the content.
I want to display the teaser at one place of the site (e.g. div) and the rest of the entry at another place (other div)
Now the excpected behaviour of the_content with stripteaser set to true would be, that it strips off the teaser (if any) and outputs the rest of the entry. If an entry hasn't got a teaser it should display the entry.
instead it currently strips of the complete entry, if no teaser (e.g. more-Tag) was found.
I recommend the following changes to get_the_content (file: post_template.php):
line 88 - add (init variable)
$hasTeaser = false;
line 110 - add (if more tag was found)
$hasTeaser = true;
line ~121 - change
if ( ($more) && ($stripteaser) )
if ( ($more) && ($stripteaser) && ($hasTeaser) )
Change History (8)
comment:1 @lloydbudd — 8 years ago
- Milestone changed from 2.3.4 to 2.7
- Priority changed from high to normal