Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Excerpts, Read more, Pagination (http://forum.bytesforall.com/forumdisplay.php?f=20)
-   -   [SOLVED] Error in excerpt function? If cut-off point is <em> (http://forum.bytesforall.com/showthread.php?t=2409)

jankph Jul 13, 2009 10:27 AM

[SOLVED] Error in excerpt function? If cut-off point is <em>
 
AdditionalDid I discover a bug in my 3.4.01 version?

When using excerpts on posts pages, e.g. category or tag pages, if the cut-off word is formatted <em> all following text on this posts page is rendered <em>, see screenshot:

http://www.husdal.com/wp-content/upl...ata-3-4-01.jpg

I guess it is not necessarily a bug, just a consequence of an unclosed <em> tag.

EDIT:
See it 'live' here (while it lasts): http://www.husdal.com/tag/samferdsel/

EDIT2:
The same happens if any formatting is applied to the cutoff point, e.g. <strong>...this is embarrassing :(

EDIT 3:
More annoying things with excerpts: I sometimes start off a post with an image. If the image has a caption, the caption will display as first part of the excerpt. Conclusion: While excerpts are a great feature, they do have some unwanted effects.

Flynn Jul 15, 2009 10:17 AM

Looks like you're using 3.4.2. Does the problem still exist? make sure you're closing tags properly that you opened inside posts

jankph Jul 16, 2009 12:21 AM

As far as I can see, it's still persisting. I am closing my tags, but it seems the excerpt function just cuts off the post after the set number of words, regardless of whether this is inside an opened formatting tag or not.

Well, there are two ways around this for me:
1. I always use the 'more' tag after my opening paragraph, so showing 'full posts' will just show an 'excerpt' anyway.
2. I can add my own excerpt to the post. If an excerpt exists that is what will be displayed. But it will be without the trailing '[...]' though.

Flynn Jul 16, 2009 01:22 PM

There is no "is tag still open" logic in excerpts. That's probably why WP just strips them altogether. Atahualpa adds the option to replace the ellipsis with a link, adjust the length of the excerpt, and define no-to-be-stripped tags, but does not add that "is tag open" logic either.

jankph Jul 16, 2009 01:41 PM

You're right. It's just me overlooking the (too) many options in Atahualpa. If I set it not to not strip any tags, then everything is perfect. If I set it to strip, say the 'em' tag and cut off after 55 words, and word # 55 happens to be emphasized, then all following posts will have their text emphasized. I had no idea that the 'stripping' was what took care of that. My mistake. Simply too many great options in this great theme. Thanks!


All times are GMT -6. The time now is 07:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.