I use YARPP and love it, but one thing makes me crazy. I use the wordpress caption tags for images in my blog, and the related posts shows the caption image code instead of the excerpt. YARPP takes the first paragraph, not the post excerpt.
I think that would be better YARPP try first to take the excerpt, and them the first paragraph. Is this a easy fix?
I have the same request — I have a lot of caption tags showing up in the related post feature and it looks pretty awful. Isaboya’s request would fix the problem for me!
The easiest thing to do would be to turn off the “show excerpt” setting. The WP excerpt is much too long for most user’s blogs.
I don’t have any plans to add such a setting to YARPP–instead I will document the use of the
yarpp_sqlcommand so that people can write their own YARPP-based queries and pull exactly the data they want from each post.
Even I have a similar problem. I have an image with caption at the start of every post and YARPP’s output looks pretty bad in such a case. Pls do something about it.
Hmm… perhaps then I’ll take the first
xwords from the excerpt rather than the first
xwords from the content… would that work better for everyone?
I like your idea as long as its an option. Not every post gets an excerpt…
@domainpubber – Hm? Really? Not every post gets an excerpt??
@domainpubber – WordPress uses the first paragraph as excerpt every time when you dont include one. Look:
Template Tags/the excerpt – Displays the excerpt of the current post with […] at the end, which is not a “read more” link. If you do not provide an explicit excerpt to a post (in the post editor’s optional excerpt field), it will display a teaser which refers to the first 55 words of the post’s content. Also in the latter case, HTML tags and graphics are stripped from the excerpt’s content. This tag must be within The Loop.
@mitchoyoshitaka – If you change the sql query to pull out the first paragraph of excerpt instead of content, problem solved. The excerpt funccion strips out the caption tags by default.
@lsaboya– thanks for finding that reference– I was being too lazy. 🙂
So this means I can just take the first x words of the excerpt and resolve these issues, yes? Can you think of any situations where that would be a problem?
@mitchoyoshitaka – Well, take the excerpt instead the post’s content isn’t a problem. People who use the excerpt, like me, will be happy. Other users don’t even note the diference. The plugins have a cool range of opitions, so everybody can customize the output to theirs needs. I cant see any problem.
@lsaboya – this change was made in 2.1.4.
Mitcho: thanks for this change.. right away I saw an improvement in my results, however, I have a question.
Are you pulling this new excerpt directly from the excerpt field in the database, or are you accessing the excerpt via WordPress’s excerpt function?
Because now when a post has an excerpt, that gets displayed, but when it doesn’t have an excerpt AND it has a [caption] tag early in the first paragraph, the [caption] tag appears in my ‘related posts’ portion of my site, and looks bad.
I believe, and maybe someone can correct me, the the_excerpt(); function sanitizes the content for you, so even if you had a [caption] tag, it shouldn’t appear. If you are pulling the excerpt directly from the database, this function never gets called.
Thanks so much for the amazing plugin!
@kingkong954 – your suspicions are correct–the current iteration just uses the except information from the database and runs some formatting filters on it, though, alas, apparently not the shortcode-expanding filter.
While I’m not sure why the shortcode filter isn’t running there, I’m not bothering trying to figure it out: the next major revision to YARPP (coming in hopefully a month or so) will display related posts in an (underlyingly) very different fashion, actually using the
the_excerpt()function, which will take care of these woes for you. ^^ Look forward to it.
Great, thanks for looking into it, and keep up the awesome work!
- The topic ‘[Plugin: Yet Another Related Posts Plugin] Show excerpt, not only the first paragraph’ is closed to new replies.