Resources

My Agape try

Your Agape try


Support Forum

You must be logged in to post Login Register

Search 
Search Forums:


 




Using first 50 character teaser

UserPost

1:06 pm
March 12, 2009


danf

Member

posts 24

1

Hi Kevin - When using the Excerpt, Pre-More, or first 50 characters, there is an issue when doing this for the_content.

When using the_excerpt, it uses strip_tags to remove all html formatting (unless you are overriding this function, which would require you to also perform a strip_tags there).  But with the_content, it is displaying the html tags and counting those towards the 50 characters.  So, if the content starts with html, it will cut it off half way and be poorly formed html.


So, when using teaser on the content and there is no excerpt or more tag, can you add a strip_tags to it so that it doesn't display any html tags?

Thanks


3:16 pm
March 12, 2009


Kevin

Admin

posts 2402

2

danf said:

When using the Excerpt, Pre-More, or first 50 characters… with the_content, it is displaying the html tags and counting those towards the 50 characters.  So, if the content starts with html, it will cut it off half way and be poorly formed html.


Good point. Beginning with rc9.9312.c, I run the content through strip_tags before slicing off the first 50 characters.

3:42 pm
March 12, 2009


danf

Member

posts 24

3

Thanks Kevin!

Looks much better :)



About the Agapetry forum

Currently Online:

13 Guests

Maximum Online: 150

Forums:

Groups: 2

Forums: 7

Topics: 1186

Posts: 5409

Members:

There are 1176 members

There are 1 guests


Kevin has made 2402 posts

Top Posters:

metal450 - 159

Ragnar - 105

YikYak - 70

whiteorb - 44

Daisy - 35

Administrator: Kevin | Moderators: Kevin