Opened 17 years ago
Closed 16 years ago
#6312 closed defect (bug) (fixed)
parameter 'stripteaser' of get_the_content does not work as expected
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 2.8 | Priority: | normal |
Severity: | normal | Version: | 2.3.3 |
Component: | Template | Keywords: | has-patch, stripteaser, the_content, more, early |
Focuses: | Cc: |
Description
Hi there,
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) )
to
if ( ($more) && ($stripteaser) && ($hasTeaser) )
regards,
maik
Attachments (2)
Change History (8)
#2
@
17 years ago
Hello again,
i hope i did the .diff right - unfortunately it won't render as html..
i'll keep the thing w/ the milestone in my mind
just didn't knew it as this is my first ticket
#3
@
17 years ago
ok - i rebuild it using a tut from peter westwood and now it renders correct;
hope you'll find this useful
regards,
maik
makibo, please don't change the milestone. Leave that for core contributors. Could you attach a patch vs trunk?