[wp-trac] [WordPress Trac] #6312: parameter 'stripteaser' of
get_the_content does not work as expected
WordPress Trac
wp-trac at lists.automattic.com
Thu Mar 20 17:22:38 GMT 2008
#6312: parameter 'stripteaser' of get_the_content does not work as expected
----------------------+-----------------------------------------------------
Reporter: makibo | Owner: anonymous
Type: defect | Status: new
Priority: high | Milestone: 2.3.4
Component: Template | Version: 2.3.3
Severity: normal | Keywords: stripteaser, the_content, more
----------------------+-----------------------------------------------------
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
--
Ticket URL: <http://trac.wordpress.org/ticket/6312>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list