WP plugin: the_excerpt Reloaded
- plugin:
- the_excerpt Reloaded
- version:
- R1
- download:
- the-excerpt-reloaded.zip
- source:
- the-excerpt-reloaded.php
With time on my hands this afternoon I decided to use some up and post about my last *older* WordPress plugin previously gone unmentioned on guff.
Based on the_excerpt, the_excerpt Reloaded, when a post does not contain an excerpt, displays the contents of the post (typically abbreviated), which can be customized on which HTML tags to allow, length of the excerpt (in words), “more…” link, and filtering type. The plugin’s function the_excerpt_reloaded() must be used in The Loop.
To install and use the_excerpt Reloaded, download the zip file, extract the-excerpt-reloaded.php, upload this to your wp-content/plugins/ directory, and activate the plugin in WordPress. The function the_excerpt_reloaded() must be used in The Loop.
Usage:
<?php the_excerpt_reloaded(excerpt_length, 'allowedtags', 'filter_type', use_more_link, 'more_link_text', force_more_link, fakeit, fix_tags); ?>
Parameters:
- excerpt_length
- (integer) Number of words to display before ending the excerpt. Default is
120. - allowedtags
- (string) Defines which HTML tags to retain in excerpt. Use the format
'<img>'. For multiple tags, enter as single string:'<a><img>'. Default is'<a>'. - filter_type
- (string) Defines how WordPress should filter/format an excerpt’s content. Options are based on content/excerpt tags:
'content','content_rss','excerpt','excerpt_rss'. Set to'none'to display raw content. Default is'excerpt'. - use_more_link
- (boolean) Should the “more” link be displayed (
TRUE) or not (FALSE). If set to false, function displays ellipsis (…) if content more than that displayed; neither link nor ellipsis displays if output is less than excerpt_length; Defaults toTRUE. - more_link_text
- (string) If use_more_link is set to
TRUE, set this to define what text to use for the link. Default is'(more...)‘. - force_more_link
- (boolean) Display more link (
TRUE) or not (FALSE), even when excerpt is less then excerpt_length. Defaults toFALSE. - fakeit
- (integer) Use content as excerpt (
1) or not (0) if excerpt is empty. Set to2to force content as excerpt under all conditions. Defaults to1. - fix_tags
- (boolean) “Repair” HTML tag elements (
TRUE) or don’t (FALSE). This is implemented to deal with improperly closed tags which may be caused by excerpt_length. If fix_tags is set toFALSE, the plugin will not attempt XHTML validation and repair on improperly closed tags (due to excerpt_length breaking them in mid-element). Defaults toTRUE.
Examples:
<?php the_excerpt_reloaded(); ?>
Displays defaults: 120 word excerpt; allow anchor (<a>) tag; ‘excerpt’ as filter type, use “(more…)” as more link if excerpt less than content; fake content as excerpt unless post has an excerpt.
<php the_excerpt_reloaded(25, '<img>', 'content_rss', FALSE); ?>
Displays: 25 word excerpt; allow image (<img>) tag; ‘content_rss’ as filter type; do not use more link; fake content as excerpt.
<?php the_excerpt_reloaded(50, '', 'none', TRUE, 'Keep reading >>', FALSE, 2); ?>
Displays: 50 word excerpt; no allowed tags; raw content output; “Keep reading >>” as more link if excerpt less than content; use content for excerpt even if excerpt exists.
Additional Information:
To make formatting the more link easier, the_excerpt Reloaded wraps the link in a <div> tag and assigns the CSS class ‘more-link’ to it. Here’s an example stylesheet declaration for it:
.more-link {
font-style: italic;
text-align: right;
}
Author: Kaf Oseo
Categories: WordPress
Comments: (288) · Leave a comment · Comments RSS2 · Trackback URL
Your link to the .zip file is pointed to post-updated.zip instead of the-excerpt-reloaded.zip. Thought you might like to know. :-)
Yoinks! I’ze shones the world I copies and pastes.
Fixed.
Hi. Nice work. You may want to consider a delimiter to be used instead of number of words.
That would allow for way more flexible excerpts or varrying lengths.
plebian, like the
<--more-->Quicktag as it behaves with the_content() tag? I’m working on an update, so I’ll look at this. Thanks.If you added the delimiter, why not just use the tag?
the ” tag” is what i meant in the earlier comment.
dang it, the *more* tag. :)
A ‘more’ link is used in the_excerpt Reloaded, but the plugin ignores the Quicktag in a post’s content, much like the standard the_excerpt() tag does. But then, my plugin is not standard…
There is no spoon, but there is a ‘more’ tag!
Kaf, your a WordPress Guru mate!
I think WordPress is a fantastic CMS but I beleive there major downfall is useability and experience design in general. I mean in the process of putting together what i consider a basic blog/ site i’ve had to download over 15+ plugins to get it to function as it should.
The excerpt reloaded should come as a standard plugin with WordPress me thinks “)
Thanks Richard. I consider myself just another WordPress user with a strong coding bent and serious need to customize. Gurus get paid…
Wonderful plugin! Thanx a lot! My blog was showing awful things in posts with Exhibit pics, I couldn’t get rid of them until I found this site via Carol’s one (oh-dear dot org). Many thanx again!
It would seem the link to your zip file has gone awry. I keep getting your main blog page when I try to download it. I went ahead and copied/pasted the code from your PHP display page for the excerpt Reloaded plugin but when I tried to activate it I got several errors. I thought I’d see if it was a problem with my copy/paste job before moping around for help! Btw, I’m using WP 1.5. Didn’t see any reference to WordPress version compatibility for your plugin anywhere. Thanks for the plugin, it’s exactly what I need! I hope I can use it!
Hi…I’m the dork that just commented about errors with your plugin. While it’s true the zip file seems to have moved, pasting the PHP into a file works fine…if you’re smart enough to make sure there’s no extra spaces after the PHP closing tag (">). Thanks again (you might want to approve this comment for other noobs with my silly problem).
mahalie, the zip was where it belongs, but an update to another plugin of mine on the site didn’t go well and caused the issue with downloads you were seeing. This has been fixed.
Thanks for the notice!
I got a fatal error: call to undefined function when trying to include your very nice sounding pulgin . I unzipped the php file to the plugins directory, and just used the default setting of the_excerpt_reloaded. Is there any way I can figure out why it isn’t recognizing? Do I need to manually include the php file somehow? THanks.
I’m an idiot. I didn’t activate it. It works beautifully now. But I have one more question. Is there any way to make it so that the “more…” text doesn’t break to the next line but just follows right after the main text? I didn’t see a ‘br’ or a ‘p’ tag being inserted, but for some reason the ‘more’ link always breaks to the next line. Thanks again.
Cool little plugin, the default function is rubby.
Rubby? Rubbish is what I wanted. All these late nights ….
Just thought I’d pass that bit on. The “ coding causes an error when trying to validate. I hacked the pluggin to change the `s` to `s`.
Grrrrr….That should be that the divs are causing a problem and had to be replaced with spans. However, now, the nifty right-sided formatting is gone.
Hi;
I’m running WP 1.5.1.3, and your plugin works great except:
In the admin section, I get these errors (I’ve swapped some *s in for some bits):
Warning: Cannot modify header information – headers already sent by (output started at ****/****/public_html/wp-content/plugins/the_excerpt_reloaded.php:90) in ****/****/public_html/wp-admin/admin.php on line 10
…[edited by admin]…
Any ideas/solutions?
Woah! And on logout, a whole host of errors:
Warning: Cannot modify header information – headers already sent by (output started at ****/****/public_html/wp-content/plugins/the_excerpt_reloaded.php:90) in ****/****/public_html/wp-login.php on line 11
…[edited by admin]…
David, did you copy the source code and save that? See this for information on fixing your problem:
http://codex.wordpress.org/Answers-Trouble_Shooting#Headers_already_sent
Or download the zip file and extract the plugin from that.
Ok, so problem fixed. I copied and pasted the source from your .php file, still got the problem. So deleted that off my server. Then used the ZIP, and everything was OK.
Did notice that the problem occured in the files with words separated by underscores, whereas dash separated filename worked fine. I have no idea if this means anything, but maybe there’s a subtle difference between the two?
Anyway, thanks for your help – great plugin!
Hi I’m using your plugin and very happy about it, but I recognize it *kills* my links in the excerpt. Why? and How can I resolve this.
kindly regards
mms
I suspect I’m doing something wrong, but…
I inserted the code in the following manner:
–>
(commented out the original content code)
This is working fine on the list page, except the “more…” link doesn’t appear for posts that have an excerpt. Not hugely troubling.
On the full post page, the post displays like it does on the list page, so it is truncated and there is no way to see the full content. That is, this formatting seems to be applied to my full text as well.
Any ideas?
Silly me…
Here is the code I meant to paste in:
<div class="storycontent">
<!--<?php the_content(__('(more...)')); ?>-->
<?php the_excerpt_reloaded(50, '', 'content', TRUE, 'more..', FALSE, 1, TRUE); ?>
</div>
Hi Kaf,
I’m a virgin @ blogging. I’m really struggling with this one. I found the index.php file in the themes folder but don’t know where I should stick in the function the_excerpt_reloaded(). I copied index.php below. Really appreciate if you can show me which line to put the function. Thanks
“>
” rel=”bookmark” title=”Permanent Link to “>
–>
Posted in | |’); ?>
Not Found
Sorry, but you are looking for something that isn’t here.
ooops forgot to comment the loop code:
“>
” rel=”bookmark” title=”Permanent Link to “>
–>
Posted in | |’); ?>
Not Found
Sorry, but you are looking for something that isn’t here.
–>
aaaarrrgghhh Sorry, had to release my frustration. No matter where I pasted the function in index.php (from the default themes folder), I can’t get it to work properly.
I can get reloaded to generate and display the excerpt (that means the plugin is correctly activated, right?). BUT index.php still displays the entire post!
1) I uploaded the plugin from the zip file & activated it
2) I opened index.php from the themes folder (defult Kubrick) & pasted the function (php the_excerpt_reloaded(50, ”, ‘none’, TRUE, ‘Keep reading >>’, FALSE, 2); ?>) within the LOOP before the first div tag
3)What else should I do?
Pls help. This T-rex is really going nuts
Thx.
Yippppeeee I ain’t no T-rex after all.
Found the answer at http://wordpress.org/support/topic/38788
For those who just installed WordPress with the default Kubrick theme, the link I pasted above is the answer.
hey. i use this and thanks.
i use this plugin such as following.
<?php the_excerpt_reloaded(120, ‘<a>’, ‘excerpt’, TRUE, ‘more »’, FALSE, 1, TRUE); ?>
but.. if the summary ends before the tag of “a” closes, it’s not valid due to the result of folling.
<p>content summary……… <a href=”add”>link <br /><p><a href=”morelink”>more »</a></p></a></p>
i want to use <p>tag. but.. it’s nothing i want.
can u understand it?
plz answer me the way to solve this.
I can get it to work in general, but clicking the “More…” link doesn’t take it to the full post. Instead, it takes it to a page with the same excerpt, including the “More…” link. Am I doing something wrong?
Never mind, got it working. The link to the solution kc khong posted worked for me, too. I originally had his/her problem, but figured out that the_content was why it was duplicating the post (one excerpted), but I needed the same code s/he used to have it post the full post after a visitor clicks on the “More…” link.
Kudos, kudos… How can I get rid of the break it adds when I change the more_link_text?
For instance my text goes something like this:
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Keep reading>>
I’d like to get that “Keep reading>>” to follow directly after the text with no break.
Thanks for the plugin. It works, except I cannot figure out how to achieve what I need. I am using it in the archive.php template to display only excerpts and a “Keep reading” more-link.
Some posts do have text typed in the Excerpt field, others don’t.
For the posts not having anything in the excerpt field – it displays the more-link.
For the posts that have anything in the Excerpt field – it doesn’t display the more-link.
I am using this code:
the_excerpt_reloaded(30, '', 'excerpt', TRUE, 'Keep reading', TRUE, 1);According to the instructions the TRUE after the “Keep reading” should force the link anyway. What am I doing wrong? I need the more-link always to be displayed.
Thanks.
Any updates available to this plugin? Perhaps on that uses the –more– tag as a deliminater, as mentioned early on in these comments?
Shouldn’t force_more_link, do what it says, no matter what the circumstances? When fakeit is set to 1, force_more_link doesn’t do anything. The manually entered excerpt takes over, minus the more_link_text.
Hi, I’m using the following tag.
< ?php the_excerpt_reloaded(100, '', 'none', TRUE, '( Read More... )', FALSE, 2, fix_tags); ?>My problem is when it’s displayed, it’s ignoring the line breaks. I added ‘p’ tag to it (removed from the tag for now because this comment is automatically closing the HTML tags) , but it’s still ignoring it. Is there a solution for this? Thank you.
I have the same problem as Jim. How can I get the “more” link to show up on the same line as the excerpt?
Hi,
I am thinking of using you excerpt_reloaded. I want the index page to show an excerpt or part of the post with a link to the whole post. Is your excerpt_reloaded suitable for that?
Thanks,
Rhand
I’m totally new to php and just installed your excerpt reloaded plug-in. I’m using the Sharepointlike theme. I still can’t get any “read more” link to display. I have only added this code to The Loop in my Main template:
‘, ‘excerpt’, FALSE, ‘keep reading >>’, FALSE, 1); ?>
what else am I missing? I downloaded the plugin because I was having the same problem when using The_content() commands for displaying the link.
Something has gone wrong on our side, what is happening is the whole thing has gone into reverse, the whole post is now showing on the index page and the excerpt is showing in catergories, anyone know how to fix this please?
Love the plugin, got everything working except one relatively minor problem – it’s not closing OL tags even when setting fix_tags to TRUE. Is there something I can try or are there just some instances when it won’t work properly? My only real problem with this is that I’m trying very hard to have a blog that validates at all times and this breaks that when using searches or archives (where I have the plugin being used). I imagine at some point this will force the content of other excerpts below one with an OL tag to also be in a list format but it hasn’t happened yet…that would be bad. Ideas?
Beautiful plugin. One minor glitch: it doesn’t seem to close “strong” tags.
Is it possible to use the excerpt reloaded to modify the rss feed when “summary” is enabled and only excerpts are displayed in the feed. Is that ok to use with html tags?
I’m looking for solution like Jim Renaud and John Dehlin have posted–
Is it possible to have the ‘More…’ link show up on the same line as the excerpt?
I tried successfully your plugin which is very usefull. But I noticed a bug : I authorised the HTML tag “blockquote” in your function and ask it to correct the tags.
If your function cut a blockquote element, it does’nt place the /blockquote tag before ending.
Your plugin rocks. Rock on, dude.
yep. nice one!
one question:
is it possible to automatically display the thumbnail with a link to the post within the excerpt?
if it is … how do i manage this? (using wp 2.0)
thanks,
klick
Cool little plugin )
I’m with the others who’d love a way to have the “More…” link not be on a newline.
There do seem to be a number of tags that don’t get automatically closed, blockquote is one, code is another I’ve found.
One suggestion might be to somehow get together your customization options and the Fancy Excerpt code to make it automatically try to excerpt with complete sentences.
thanks for great code!
I love this plugin. I use it on all my blogs.
I do have a couple of suggestions for a future version.
1. I agree that it would be nice if the more… came at the end of a sentence (preferably a paragraph).
2. It would be nice to have the option that if there is a more quicktag in the post, the quicktag is used instead of the word count.
I’m having the same problem as moshu and bill. I’d like the “more…” link to appear always, but it doesn’t when I set force_more_link to TRUE. Perhaps this is happening whenever a manually entered excerpt exists, but is shorter than the excerpt_length (not sure). Even in this case, I’d like the “more…” link to appear.
Another issue I’m having is that I’d like to put an image in many of my excepts, always formatted ‘left’ so text flows around it and with a little padding, always clickable and linking to the permalink of the post it’s in, and always with rollover text that is makes some kind of sense (maybe the post name, not sure). Anyway, it looks like the TinyMCE editor doesn’t even use the excerpt field. I have no idea how to automate the all the steps I mentioned above so I don’t have to do them for every excerpt image. Any tips are greatly appreciated.
I really like this plug-in overall, great job!
–Sirlin
Ugh, after many hours I realized that the zip file is version 0.2 but the the “display php” file above is version R1, and actually works. (That is, if you copy and paste it into a text file and remove the space at the end of the file. That took another hour or so to figure out.)
I’ve had more trouble getting this plugin to work than anything else in wordpress, but when it does work it’s great.
–Sirlin
there’s another plugin much like this one that we use at our site called Limit Posts.
http://labitacora.net/comunBlog/limit-post.phps
Sirlin, thanks for catching that.
If you were having problems getting the plugin to work, try downloading the zip again. Note R1 will not fix *some* of the issues mentioned above, especially those dealing with proper closing of HTML tags. That’s due to WP’s balanceTags() function, which this plugin uses to “fix tags.” I’ll look to see if I can do things better when I finally get around to finish upgrading this puppy.
Yes, I am already working on what I call the Revolutions edition of the_excerpt Reloaded, incorporating a number of your suggestions, some fixes, and even a couple improvements I came up with all on my own…
I’m having an identical problem to the one Niche Marketing Guy had in October. For some reason WordPress’s auto-paragraphing does not work inside the excerpt, even when I include ” as an allowed tag. My code looks like so:
——————-
<? php if(is_category() || is_archive() || is_home()) {
the_excerpt_reloaded(120, ‘<P><b><i><u><em><strong><blockquote><img><a><ol><ul><li>’);
} else {
the_content();
} ?>
——————-
But I cannot get a new paragraph break to appear in the excerpt, unless I manually peck it in. Bold, italic, blockquote — these all appear correctly within the excerpt. Auto-paragraphing is the only thng that won’t work. Any tips? Solutions?
Hopefully I’m not crazy. Other than this problem, though, the Reloaded plugin is excellent.
Is it possible to make the more link appear when an exceprt is manually entered? Does this plugin work with v 2.02?
Only success with your superior plugin. I look forward to more of its use on my website. Utter props out to you for a remarkable WordPress plugin. Thank you for this!
Thanks for sharing this very cool plugin. Thanks for pointing out the plugin. Is there a way to modify the code so as to insert the nofollow tag, for the more link. For seo you don’t want two urls going to the same article.
R1 of this plugin fails to pass $fix_tags from the_excerpt_reloaded() to get_the_excerpt_reloaded(), which makes for some weird issues when trying to get it to format things the way you want.
hi to all, i need your help, please
I tried to install the wp-PostRating plugin, that one with a stars.. but i’ve some problems:
1 – the stars are too far from each other and not close among them as i see as default, i tried to put the code into a tag with div align=right, but don’t works.
2 – the rollover state (green color) don’t work in my site ….
Someone that use this plugin can help me ?
thanks in advance
the site where i’m trying to put this plugin is:
internet marketing lessons
the plugin site is:
http://www.lesterchan.net/wordpress/
Hi.
This plugin is great. However in the interests of customising my site, there’s two things I’d like to do that I can’t seem to figure out. One, I’d like to replace the “more” text with a graphic but I get errors when I place an tag in the conditions, and two, I can’t seem to get the “more” text to follow on from the excerpt instead of placing itself on a new line.
Sorry if these are dumb questions – I’m a blog newbie and I’m trying to customise my first wordpress theme,
TIA
Great plugin been helpful making my blog a mullet.
For Dave above me I THINK you will have to “allow” the tag when you call excerpt_reloaded e.g. instead of allowedtags you need to put in also putting the link on the end of the paragraph is impossible I THINK it’s a quirk of wordpress and the way it treats the excerpt by putting a tag on the end by default, if I’m wrong someone correct me as I would like this too.
Also this plugin for FF may help with your IE problem (http://addons.mozilla.org/firefox/1419/) as it lets you see a site as IE would render it in a FF tab.
I think this is a great idea for a plugin, however I’m having a few problems:
The “all” parameter doesn’t work
After you insert the password for a post, it doesn’t display the excerpt
Now, I’ve been looking at code since yesterday morning, and I’m extremely tired… Could anyone tell me ways I can fix this?
Thanks
Thanks for the plugin. One thing I’m not sure about, if I have a post that uses the
<!--more-->tag then it overrides theexcerpt_length, no matter how it is set (even tried hard coding it in the plugin). Using WP 2.0 – haven’t got round to upgrading yet.Is this
excerpt_lengthbehaviour normal? Thanks!Sorry to ask a (probably stupid) question, but I’m looking for a certain function and can’t find it anywhere.
Does this plugin allow me to
a) Use the “excerpt” from the write->post page
AND
b) Add a custom link at the end like “Read the full story…”??
If so, I’d be stoked. If not, any suggestions on how to do this.
Cheers
The ‘all’ parameter for the HTML tags doesn’t work. It just spits everything out without formatting at all. Can you help me out at all?
I am having the same issue as Chris above. When a Post has a MORE tag placed within it,.. it overrides the excerpt reloaded…Is there a fix for that?
Has the line break problem ever been resolved? I read all the comments but didn’t see anything resolving the issue of the “more” breaking on its own line. This looks really conspicuous especially after the ellipsis…
more
hey there, i would like to know where do i change the “more_link_text” ? Is it at the plugin or at the code that is placed in the template ? I’m trying to change the “(read more…)” to something else.
whoops… never mind…found the answer.
i would like to know how do i force a “more_text_link” , when my post is under an “excerpt” ? as i notice the “more_text_link” only appears when i do not place anything under the “excerpt” column of the post area.
Hi,
i have a problem with the image tag, there’s no break after the image. You can see it on my page. Any ideas how to fix this? Thx in advance.
Very nice. Your plugin is perfect for my Dapit Hapon, Kurtina and Isla themes :)
Thanks Kaf !
This plug-in is exactly what I was looking for. The hidden options ($no_more and $more_tag) were especially useful for me.
This plug-in is perfect for what I’m doing, but I can’t remove the category showing up on the the_keywords(). I tried adding $include_cats=’false’ and it does not work. Can someone help me?
hey there, great plugin! is it possible to change the line spacing and -height only for the excerpt? I’ve tried different things like creating a class for the excerpt but it didn’t work…help needed :)
I noticed that with your plugin there is always a space before the very first word of the excerpt. As you know, this is because of your code below:
$output .= $text[$i] . ' ';
If I get rid of the space between the ‘ ‘ to make it ” it will obviously get rid of the space before the first word but it will also take out every space between every word making the excerpt one big long word. Would you know of a way to just get rid of the space before the first word of the excerpt? Thank you for you help!
Great plugin… solved my problem with the excerpts in K2 in association with wp-alexify plugin… only one thing to say…
I have the more tag in some posts, so the excerpt in that posts goes beyond the defined lenght of the excerpt until the point that the more tag was defined in the content of the post… any choice to solve that??
IMHO there’s no need for de <div class=”more-link”> in the code, it does not validate as XHTML… I’ve deleted it and it’s working great and validates with no problem. I still haven’t solved the <!–more–> problem… so I had to delete them for now until there’s one solution… Greetings ;)
I apologize… it validates but there was lacking a </p> before the <div class=”more-link”>
The code gets finally like this
$output .= ‘</p><’ . $tag . ‘ class=”more-link”>
Greetings, and sorry for the multiple comments
It doesn’t appear to work on WP 2.03. I’m running the_excerpt_reloaded on several WP1.5x installs, but during my testing for an upgrade to WP2.03, the word count is completely ignored–if a post has an excerpt, the entire thing is shown, otherwise the post is shown down to the <!–more–> tag.
To wit, both of these turn out exactly the same information–several hundred words in the case of some posts:
<?php the_excerpt_reloaded(120, ”, ‘content_rss’, false); ?>
<?php the_excerpt_reloaded(5, ”, ‘content_rss’, FALSE); ?>
Both are also working correctly currently on WP1.5 installs. All other params work–content is different from content_rss, and so forth; it’s just the word count that completely fails.
Okay I am going to risk looking extremely stupid. I have activated the plugin for excerpt_reloaded. what now? I thought I would be able to modify it somehow from the admin section. I cannot see any reference to the plugin
Okay I’m getting somewhere. Now the problem i have is I click on the header of the excerpt and it goes to another page with only the excerpt and not the full content. How do I fix this?
First, thanks Kaf, for this plugin and all the other good work you do.
MrAnderson: Thanks for the tip on adding the
</p>. (I first tried it in the$force_morepart of the “if” statement without really paying attention and realizing it needs to go in the “else”.)I think there is a small chance this could cause a validation error if you didn’t happen to be in a
<p>tag, but it almost always causes a validation error otherwise so this is an improvement. (I notice there is always a<br />tag right before themore-linkbut not sure where it comes from and not going to investigate at the moment.)I was also interested in overriding the
<!--more-->link and got that to work by commenting out some code:/* if(!$no_more && strpos($text, '<!--more-->')) {
$text = explode('<!--more-->', $text, 2);
$l = count($text[0]);
$more_link = 1;
} else { */
$text = explode(' ', $text);
if(count($text) > $excerpt_length) {
$l = $excerpt_length;
$ellipsis = 1;
} else {
$l = count($text);
$more_link_text = '';
$ellipsis = 0;
}
//}
How do you guys keep the formatting of the excerpt consistent with how the entire post is? My paragraphs aren’t starting on a new line – everything in the excerpt is all showing together, which doesn’t look right on various posts.
Thanks.
Excellent plugin – did just what I needed! See it in action on our homepage at http://www.vibetechnology.com (it’s the box above the sidebar that functions as a landing pad / related posts / featured post area that switches for search engines / single posts / and “feature” category, respectively).
Thanks!
For those of you that had trouble got to line 70 and change div to span:
$more_link_text=”(more…)”, $force_more=true, $fakeit=1, $fix_tags=true, $no_more=false, $more_tag=’div‘,
to:
$more_link_text=”(more…)”, $force_more=true, $fakeit=1, $fix_tags=true, $no_more=false, $more_tag=’span‘,
The more link now displays inline at the end of the post and NOT on a seperate line. This worked for me anyway.
Hello….how can I have the “more link” to appear in the same line as the excerpt. I think there is a line break somewhere. Thanks!
I am running latest wordpress, when I activate this plugin it works ok on index page but when I try to goto admin page I get blank page then I have to rename the file to get in.
anybody has any idea what am I doing worng here?
hmm… i need a bit of help and i’m all set
I want to do something like
“Continue Reading the_title()”
i have this
‘, ‘content’, use_more_link, ‘Continue Reading’, false, 1, TRUE); ?>
This does exactly what I hoped it would do! Thank you so much for making this plugin.
Hi, is there any way to specify the title tag of the “read more link”?
I have not seen any parameter to set this. Foget me if I am wrong and
many thanks for the plugin!!!
Im having the same problem as a few other people, cant get paragraphing to work. Does anybody know whats wrong here?
Dear Kaf Oseo, now I have WP 2.04. Thanks for the wonderful plugin! Anyway, nice work ;)
Nice plugin.
For all those baffled with the paragraphs not showing up, try adding the filter_type parameter to ‘content’. That worked for me, since we needed the excerpt to be taken from the content.
@ Entee or anyone else who knows
Would you care to elaborate entee – where have you added the filter-type parameter exactly?
Or if anyone knows how to sort out the problem of the ‘p’ tag not working it would be much appreciated.
Very nice plugin Kaf – but then, they always are :)
Thanks
I have ALL TRIED … but don’t see where is the solution : How to use your excellent script to have only … the pic of the article (and whynot, the clickable title of the post) …
If a post already has the ‘more’ link in it the plugin displays the original excerpt, no matter the filters and parameters i apply to it … can this be fixed somehow ???? (my original excerpts have 120 words and i need only 35 words excepts in the sidebar … )
thanks the plugin seems to be working
the only question is
WHY IS THIS A PLUGIN AND NOT PART OF THE MAIN AP
i mean isnt it reasonable that people want
an image in the excerpt to make the page look nice
or maybe they want to control the size of the excerpt
Maybe Google will buy you out and make it part of the ap
hehe
Thanks I really didnt want to edit the source to get
an image working
you helped me a lot
Hi, love your plugin. I believe I found a bug on line 119, not sure. Should the conditional “!= $allowed_tags” read “!= $allowedtags”, without the underscore?
if(‘all’ != $allowed_tags) {
$output = strip_tags($output, $allowedtags);
}
This was causing me some trouble.
This PlugIn was that, what I searched. Very Good!!! I love it.
Hi,
I’m just trying to figure how to use your plugin so that when a category is selected, the first page viewed is simply a listing of the posts stored under it with a summary. I don’t want the fefault view of posts to be summaries, though maybe that’s the choice I’ve got?
I’m sure such a thing is possible but how?
Robin
I am new to this plugin and was having problems getting bits to work i.e. allowedtags=’all’ and decided to have a closer look and here I present my fixes. Sorry if others have already spotted these but I could not find them anywhere.
allowedtags=’all’ does not work as there is a coding error the line
if(‘all’ != $allowed_tags) {
should read
if(‘all’ != $allowedtags) {
Also If others are interested I wanted the “read more…” to appear no matter what so I deleted the line:
$more_link_text = ”;
Hope this helps
Have just spotted the post from Jeffrey Warren 3up. Wish I had spotted this earlier would have saved me some time. Never mind.
thanks for this great plugin.
I have a problem though with it. I use it in a bilingual site, using Polyglot. With polyglot, which uses filter hooks, I can get the_excerpt translated, but I cannot get the_excerpt_reloaded translated. Do you have any suggestions I could use to get the_excerpt reloaded translated ? I would appreciate it very much.
Rembem
Rembem, are you setting the $filter_type argument to either ‘content’ or ‘excerpt’ in your parameter string? The plugin applies filters before returning (that is, echoing) the excerpt, though if that doesn’t fix things, it’s (always) possible Polyglot runs before the_excerpt Reloaded. There is a ‘plugins_loaded’ hook that could be put to use here, but without having looked at Polyglot first I couldn’t say where.
Everyone else, I’ll upload a fix for that little bug with $allowedtags…
Hi Kaf,
I was using the argument ‘excerpt’, tried changing it to ‘content’ but this did not help. Maybe your solution with plugins-loaded would work,
, but I managed to solve it, by adding some code to the_excerpt_reloaded function. I’m a php newbie, but my solution works:
Just before
$text = (empty($post->post_excerpt)) ? $post->post_content : $post->post_excerpt;, I added:if (function_exists('lang_picker_respect_more')) {to the function get_the_excerpt_reloaded$post->post_content = lang_picker_respect_more($post->post_content);
}
This “lang_picker_respect_more” function is a function in the Polyglot plugin.
It’s probably not the most elegant solution, but it works! Further, in order to translate the “more” text, I changed the ‘more’ text in wp_the_excerpt_reloaded, so it can be gettexed:
if(!isset($more_link_text)) $more_link_text = __('...more');If you want to see it in action, check this page with excerpts of my site:
http://www.steppingstonesforafrica.org/category/nieuws
and toggle the English/Nederlands button.
Thanks,
Rembem
Some new findings about compatibility between the-excerpt-reloaded and Polyglot plugins.
The above solution didn’t work in the end, because it renders polyglot functions that are called after the content useless (like the languageswitch in the metacontent under the post text).
I found out that if I set the ‘fake-it’ argument in the-excerpt-reloaded on 0 (or 1 with an actual excerpt being present), Polyglot translated the text correctly. But if I set fake-it to 2 (or 1 with no actual excerpt being present), (with the result that a trimmed version of the content is used instead of the actual excerpt), it did not tranlate. The cause is that the-excerpt-reloaded not only trims the content, but also the tags that are used in the content for the languages used (Polyglot uses tags like
english textdutch text)The solution was simple in the end. Polyglot works fine with the excerpt that WP makes if it trims the content without an actual excerpt being present. So why not use that trimmed content:
In the_excerpt_reloaded, replace:
$text = (empty($post->post_excerpt)) ? $post->post_content : $post->post_excerpt;with:
$text = wp_trim_excerpt($text);This function is the function that WP uses itself. It is located in functions-formatting.php
Problem solved, halleluja! Hope this helps someone.
It might be a good idea to implement in the excerp_reloaded plugin.
My example code in the above post is not coming across. Second try:
Polyglot uses tags like:
[lang_en]english text[/lang_en][lang_nl]dutch text[/lang_nl]There is a similar plugin out there (Content Extract) and there is just one thing I’d like to know before I choose between the two. Does
the_excerpt_reloadedalso work by inserting text into the optional excerpt according to the specified excerpt length?My friend said this is how
content_extractworks and she ended up having to delete the optional excerpts of every post manually just to change the excerpt length. I have quite a lot of entries on my blog and would like not to have to do that.Thank you.
How can I exclude certain categories?
Thx!
My code:
">
">
', 'none', TRUE, 'Keep reading >>', FALSE, 2); ?>
code not working…so ya, how would i exclude a category?
I need flash objects in my excerpt … how can I do that? I’ve set allowed tags to all … but that is not working … :(
PS … my flash object is generated by a plugin … (adio player … )
Using your plugin on theme 2813, works great :). couple of small concerns though, would really appreciate if you could look at the middle column on my site and help me resolve the following:
1.A bullet displays between the excerpt links and excerpt content. How do i remove it?
2. Why is there a line/paragraph break after the excerpt and the “#.” Can I remove it?
Hi kaf great plugin,
Is there a way for the more link to go the post page and not use the post/more#-.
How do we get rid of the /more#-
Many Thanks
Pete
Hi kaf
your excerpt reloaded plugin work great
i like to know how to use it with tag using UTW plugin.
i already posted in wp forum but no reply it’s been more than week here is the link http://wordpress.org/support/topic/99219?replies=1
Thank you
Hi,
I like this plug-in.
I have a couple of comments.
1. With this form: I filled out a long comment but forgot to put my email. I hit submit and got the error that I missed a required field. But when I hit back, my comments were gone and I had to retype. Would be nice if they were retained. Maybe javascript error handling as well as server so that you’re left on the page?
2. It seems the more link doesn’t apply if I put an optional excerpt in my post. However, I do still want the visitor to click more to see the entire post even though I put an optional excerpt. I tried setting the force_more_link; same thing–it seems like it only applies to an excerpt that is derived from the content.
3. With the syntax: when a parameter is left empty, it usually means to use the default. But it looks like with this plug-in, passing it an empty string for a parameter doesn’t mean to use the default. For example, I wanted to set the excerpt length, allowable tags, and force_more_link, but leave everything else as the default. I used this syntax:
‘,”,”,”,TRUE); ?>
This resulted in the more link disappear, until I filled in the more parameters that came before the last one I wanted to set:
‘,”,TRUE,’more…’,TRUE); ?>
Great plug-in though. A lot of flexibility.
Thanks.
Oops, it didn’t quite leave the code the way I had typed it in my comment, but you get the idea. Also I’m using WordPress 2.0.5.
I am having a grievous time with the auto-paragraphing. Isn’t there a solution to this?? It’s driving me crazy!!!
Got the Everything working fine. But two things How to I make the more link appear immediately after the .. rather than on the next line. Seems like there is an invisible tag somewhere. Secondly how do I set the size of the image that appear in the excerpt to be small that the one in the full post? I want thumbnails in the excerpt only
Thanks for the plug-in. It was exactly what I was looking for!
akurashy (and those of you who wanted to know how to put the title with the more_link_text):
Change this:
if($force_more) {
$output .= ‘ <’ . $tag . ‘ class=”more-link”><a href=”‘. get_permalink($post->ID) . ‘#more-’ . $post->ID .’” title=”‘ . $more_link_title . ‘”>’ . $more_link_text . ‘</a></’ . $tag . ‘>’ . “\n”;
} else {
$output .= ‘ <’ . $tag . ‘ class=”more-link”><a href=”‘. get_permalink($post->ID) . ‘” title=”‘ . $more_link_title . ‘”>’ . $more_link_text . ‘</a></’ . $tag . ‘>’ . “\n”;
}
To this:
if($force_more) {
$output .= ‘ <’ . $tag . ‘ class=”more-link”><a href=”‘. get_permalink($post->ID) . ‘#more-’ . $post->ID .’” title=”‘ . $more_link_title . ‘”>’ . $more_link_text . $post->post_title . ‘</a></’ . $tag . ‘>’ . “\n”;
} else {
$output .= ‘ <’ . $tag . ‘ class=”more-link”><a href=”‘. get_permalink($post->ID) . ‘” title=”‘ . $more_link_title . ‘”>’ . $more_link_text . $post->post_title . ‘</a></’ . $tag . ‘>’ . “\n”;
}
Basically all you do is add the post->post_title to these lines. If you want just the title of the post to appear, then you could just lose the $more_link_text variable in these lines.
This plugin helped me out tremendously! Thanks!
Great idea for a plugin, don’t know why the_excerpt() doesn’t have this kind of functionality.
anyway, I’ve got an issue. The plugin seems to be removing (or causing the browser to ignore) all of the formatting in my posts.. INCLUDING LINE BREAKS! This is obviously unacceptable. Does anyone have a thought regarding what specifically would be causing this behaviour? I’ve tried several different templates, same issue. Using v2.1
I like the plugin a lot but is doesn’t work very well with Markdown. I solved that by changing the
return $output;to
if(function_exists(Markdown)) {
return Markdown($output);
} else {
return $output;
}
For those having problems with formatting the paragraphs (even when allowtags = all), just be sure to add filter_type = content.
That solved the problem for me.
I had a problem with a missing closing “p” tag whenever the length of the excerpt was exceeded and the “…” was shown. Even with “p” in the “allowedtags” list and “fix_tags” TRUE, there was no closing p-tag. This fixed my problem:
———–
Change:
$output = rtrim($output, "\s\n\t\r\x0B");
$output = ($fix_tags) ? $output : balanceTags($output);
$output .= ($showdots && $ellipsis) ? '...' : '';
to:
$output = rtrim($output, "\s\n\t\r\x0B");
$output = ($fix_tags) ? $output : balanceTags($output);
$output .= ($showdots && $ellipsis) ? '...' : '';
thanks for the neat plugin!
huh?
the code-example above got the p-tag in question stripped!
Insert a (/p) after the “…” (replace the normal brackets with “less-than” “greater-than” brackets):
$output = rtrim($output, "\s\n\t\r\x0B");
$output = ($fix_tags) ? $output : balanceTags($output);
$output .= ($showdots && $ellipsis) ? '...(/p)' : '';
Hi, maybe I missed a solution in the comments but is there any way to get the “Read More” (or whatever) link to appear when you write a post’s excerpt yourself?
Thanks.
hi … i’ve been using this plugin for ages, but only today realised there’s a small bug. which a couple of folks have already pointed out – but it’s still here
http://guff.szub.net/source/the-excerpt-reloaded.php
if('all' != $allowed_tags) {
$output = strip_tags($output, $allowedtags);
}
should be
if('all' != $allowedtags) {
$output = strip_tags($output, $allowedtags);
}
that works nice
For the record, the above change is on line 121.
I am having problems with validation as the tag seems to be the problem. I know some have discussed this earlier, but it is above me. I know zero about code and would appreciate if you could provide the code to correct this validation error and where to put it, in layman terms. I am using the Apathy theme from Perishable.
Thanx
Sorry, the “div” tag is not validating
great plugin! How can i put the expert in widget? i would love to use sideblog that have his own excertp but not cool like yours. Yours include image sideblog not.
another prob.
how can i show a flash video in the excertp…..
This plug in is a perfect fit to my needs. Thank you!
Just thought I’d clarify some things to non-coders:
There seems to be undocumented arguments. The full list of arguments can be retrieved from the php file by looking at the function declaration of the_excerpt_reloaded. In the ‘R1′ version the list of arguments in order is as follows:
excerpt_length: defualt=120
allowedtags: defualt=’<a>’
filter_type: defualt=’none’
use_more_link: defualt=true
more_link_text: defualt=”(more…)”
force_more: defualt=false
fakeit: defualt=1
fix_tags: defualt=true
——————————– The arguments below are the undocumented ones ——————————–
no_more: defualt=false (this argument seems to be the one to use if you want to ignore the <!–more–> quicktag)
more_tag: defualt=’div’
more_link_title: defualt=’Continue reading this entry’
showdots: defualt=true
nice plugin. i have it installed and worked into my template, however, the “read more” link just seems to link to a page with the post still excerpted. shouldn’t the entire post be readable when that link is clicked? am i doing something wrong?
Is this WP 2.1.3 compatible? I just installed it, off I went and suddenly my theme won’t display. Just wondering..
You might want to add the ? in the first part of the php example code for the 25 word sample. If someone had no idea what they were doing, like myself, they might just cut and paste that text and then wonder what was going on for a while. Stupid, I know. I appreciate you taking the time and making the effort to create this plugin. It’s going to be very useful to me.
Kaf,
The post displays, the updation date as March 2007, however the ZIP file has changelog of 2006 only. Have you made any change recently, if yes, where is the updated download link?
DG…
http://www.ditii.com
I’ve been searching for a plugin like this…
I’m running a site on WP Version 2.1.3 and when I activate your plugin I just get a blank page, is your plugin compatible with the latest version of wp?
thank and keep up the good work…
–> Israel
when upgrading to 2.1.3 I tested the_excerpt_reloaded() on a virtually virgin WP 2.1.3 install and it worked as specified … are you sure you have no other plugin / hack interfering? …turn off all the plugins and turn them back on one by one to find the culprit
There is a bug in code and it cause that you cannot allow all tags. On row 121 is written wrong name of variable $allowtags. To fix it, rewrite $allow_tags to $allowtags.
Thanks for this plugin. It is really good.
Thanks so much for a wonderful plugin.. Also had to change $allowed_tags to $allowedtags in your plugin before it would recognize my allowed tags.. After that it worked great..
Great plugin! Just one problem. Even when setting fix-tags to TRUE, tags are not closed and my pages do not validate. , tags etc. are not closed and continue to apply to following post excerpts. Validation reveals unclosed tags.
for those who had trouble to force the more-link, change:
} else {
$l = count($text);
$more_link_text = ”;
$ellipsis = 0;
}
to
} else {
$l = count($text);
$more_link_text = ‘more…’;
$ellipsis = 0;
}
very nice plugin, thank you!
Yes. The tags do not close at all and stuff up the display of my page. Releasing a new version soon I hope?
Great plugin, but please please please can you fix the tags-not-closing bug?
Thanks!
:)
(also, the tab order on this page results in not being able to tab through your comment form)
Does exactly what is says on the can: excellent. Thank you for taking the pain out of excerpt. ;-)
I’m also having issues with tags not being closed. I’m only allowing links to show in my excerpts, set to the first 50 characters of the original post. If the excerpt is cut off within a link, the tag is not closed if the last character is a space. A quick & dirty fix is to change that space to a nbsp whenever I notice a problem.
thanks for your great plugin but can you help me.i have a small problem, how to exclude emoticons? i use emoticons and your plugin this play include the emoticon in excerpt,like ~\:d/ :>)
thanks
Hi! I’ve fixed the $allowedtags in the code, but I’m still frustrated with what is allowed. I can’t seem to get
brorpto be allowed. Any suggestions?Oops. Nevermind!
To display tags such as p tags within the excerpt i changed the filter_type to content.
the_excerpt_reloaded(25, ‘your html tags’, ‘content’)
Hi. Great idea for a plugin. I installed it on WP 2.2, but it didn’t seem to do anything… Just thought that you might want to know. I don’t know if you’re still supporting this plugin, but I think that it is an important one :)
-Mike
I love the plugin, but i have a little problem. I made a lot of posts with a more tag and i want to keep them. So the plugin has to do everything without stripping my own more tag (.
So the lenght of the excerpt must not be counted by the plugin, and also my own more tag must appear.
Is there a solution for. I tried to comment out some code, but i cannot find a good solution.
I found the real reason why the <p> tag is not closed causing invalid XHTML, even with $fix_tags set to true. It is not a problem with the balanceTags function. The problem is introduced in the apply_filters() function. I have a fix for the_excerpt_reloaded that creates XHTML that can validate. See http://robsnotebook.com/the-excerpt-reloaded for an updated version of the_excerpt_reloaded.php with this fix.
In my previous comment, I found one reason why one tag wasn’t getting closed with this plugin. Now, I have the reason why all the other tags may not get closed, and wrote a new blog post with a fix you can download. See http://robsnotebook.com/the-excerpt-reloaded2 I think this is going to fix problems that many people are having.
Under 2.2, if i have the more tag, the excerpt reloaded uses that to split the exceprt it generates, instead of faking it with fakeit set to 2. If i dont add the more tag, the excerpt reloaded works fine. I really use it this way, allowing me to have a post with a long description, using the read more split, and showing it on the sidebar with a 20 word long excerpt.
Kaf,
can you help me, show me how to exclude the tag [audio:filename.mp3] from being display in the sidebar. i use your plugin to show 5 recent posts in the sidebar
i’m very appreciate for your help
thanks again
My website – notsonews.com – is powered by wordpress 2.2.1 and this plugin works like a charm. You can clearly see it in action on my front (static) page. You are a brilliant coder!
I have posted a “thank you” message and a “do follow” link towards this page on my about pages. Many Thanks!
Stefan
Hi Kaf,
First of all, great plugin! I’ve been using the excerpt_reloaded for a long time now. However, lately I’ve been doing some tweaks with a new theme and have problems incorporating this plugin.
What I want to know is if it was possible for me to use the excerpt_reloaded for some posts and let other posts display the text inserted in the Optional Excerpt box for that post.
I tried doing it but what I get is all posts get cutoff in the parameters I specified in the plugin’s function.
Would appreciate it if you can help me solve this issue. More power! :)
Kaf,
thanks for the plugins. Works like a charm;)
I noticed one oddity, though. I use the function ‘, ‘none’, TRUE, ‘Keep reading >>’, FALSE, 2); ?> but the images are not included properly. Instead, the appear within the last sentence of the excerpt.
It’s hard to explain. If you wanna take a look visit my site.
Excellent plugin – thank you so much for this! It perfectly solved a dilemma I was having with a static (non WP) site that we added a WP Blog to in it’s own subdirectory – we needed to add a “teaser” excerpt to the sidebar of the main static site, and WP’s built-in “the_excerpt” wasn’t giving us the flexibility that we needed – I’m so glad I found your plugin – I give it 5 stars!
I would really like to modify it in one tiny way if you can tell me how to – I noticed it puts the “more_link_text” on a separate line – looks like separated by a tag – I’d like it to be inline with the last word of the excerpted text from our content, so that it looks like this:
‘last few words…….(read more)”
Can you tell me if/how I can do this? Many thanks again!
thanks for the great plugin!
I would know a thing, if it is possible:
i have a post that starts with an image.
In my home page i would show only the image without any text…how could i do?
thanks!!
je cherchais depuis longtemps un plugin du genre… flexible, performent, et facile à utiliser
merci
great plugin!! exactly what I wanted!! thx ;)
Hi all,
I’ve played around with the plugin and I’m completely stuck using this with WordPress 1.5. No matter what I change, it strips every tag except the image. I have tried:
- changing the $allowedtags to ‘all’
- Fixing the bug on line 121, where the underscore was ($allowed_tags)
- adding specific tags to the line where I use it, like strong, br, etc
None of this is working. It does show the image though, but only that. Can anyone please help? I beg you!
@Trisha, search the program and find the 2 “div” tag references and replace them with ” (blank space). Now it will default to ” tags. Worked for me. :)
Should be line 63 & 70 in your editor.
S
I’m using this in WP 2.2.3, and I’m wanting to display smilies in the excerpt. Any ideas of how? Thanks in advance!
Excellent plugin. I feel however it is missing the ability to make the “more” link go to an external web site. My intitial thoughts were to combine this plugin with < ?php echo get_post_meta($post->ID, ‘KEY’, $single=true) ?> in this manner: < ?php the_excerpt_reloaded(20, ‘<?php>’, ”, TRUE, ‘<a href=”">read more…</a>’ ); ?> Where the php would then call on a Custom Field key to insert a link the user defined on a Write Page. Any thoughts as to how I can include php in this? The above does not work, by the way.
For me it creates excerpts but clicking on “more” sadly sends me to a page where the excerpt appears again. The rest of the article is missing.
Hello,
does it work im WP23?
Denis:
This plugin works fine on my WP 2.3 installation — just like it has since 2.1!
–Damon
Force more link is not working for me.
I want to use Excerpt Reloaded to display posts w/o images and force users to click on “more” in order to see the pictures. The problem is that I can’t seem to force the More link if the content is less than the excerpt setting.
I’m on WP 2.2.2
using the following in my single post template:
<?php the_excerpt_reloaded(50, ‘‘, ‘content’, true, ‘Keep reading >>’, true, 2); ?>
Any ideas?
Dude, this plugin so completly kicks ass! Thank you! It seems kinda wacky that it’s not “friendlier” for folks to do this in WP via the control panel or something and you have to crack the hood and fiddle…
Good job!
I’m back with another question…
If you look at this http://thewholesalemonkeyfarm.com/category/testing/ you’ll know what I’m talking about.
I’ve installed NextGEN gallery, and it apparently inserts it’s own “tags” that are interpreted in most contexts to actually render a gallery/album/image. However, on archive’ish pages like my example above, when I use your excerpt_reloaded it actually shows the NextGEN tag like [gallery=2].
How could I configure excerpt_reloaded so that it either strips those tags, or it actually renders them? I’m not sure if it’s an excerpt_reloaded issue or a NextGEN Gallery issue.Help?
Thanks for this plugin. I’m using K2 and WP 2.3 and I finally figured out how to get it to do what I wanted; that is an excerpt on the front page and the full post everywhere else. I used a conditional block in the_loop, although I do not seem to be able to paste it here to help someone else. Never mind.
I also stripped out the Div tags, as advised by Steve above, to get the continuation link on the same line.
One particular post is broken, but I am not too worried about that for now.
Now to see if I can also style the front page slightly differently!
Thanks again.
Is it possible when including images in the excerpts to change the format of the pictures to thumbnails instead of the regular size they appear on the site? Also want to change the positioning of the images to always display on the left side of the excerpt, instead of wherever they appear on the post. Please let me know
Greetings – love the plugin. Just curious though – do tags in the post count toward word count? I’m getting varying results in content length, and wonder if this is the culprit. Thanks!
Evan
Thank you for this plugin! It has really helped me building my own website!
I would like to display excerpts of only category 6 (News) posts on my front page. My code now looks like this:
< ?php the_excerpt_reloaded(120, ‘‘, ‘filter_type’, TRUE, ‘Read More’, FALSE, 2, TRUE); ?>
Posted in
and is displaying posts in “Uncategorized” as well as “News”. How do I restrict to just category 6?
Also, where do I set the number of excerpts to display?
Thanks in advance – I’m a newbie and am sure these are dumb questions…
Sorry – code looked fine in preview but only part of it posted – trying again – apologies…
< ?php the_excerpt_reloaded(120, ‘‘, ‘filter_type’, TRUE, ‘Read More’, FALSE, 2, TRUE); ? >
Posted in
Hi,
first of all, thanks for this very handy plugin!
Is it possible to have always only 8 words displayed even if the more-tag is used after let’s say 20
words?
This is my coding:
< ?php the_excerpt_reloaded(8, '', 'none', TRUE, 'Eintrag lesen', TRUE, 2); ?>THANKS, Hannes
Hello,
I want to know if someone can help me with these problems that I have, using that plugin:
- Why the Horizontal Ruler isn’t rendered well? When I put an Horizontal Ruler, a Paragraph ending tag is placed right after it.
- Why all the code inserted in the page editor of WordPress is duplicated in the html source code, one being in html comments?
Thanks
all I wanna do is display the image from my excerpted feed. it’s driving me nuts, can someone steer me in the right direction?
hi , i was thinking is ther anyway to allow tag such as table, tr, and td tags????? i try but cannot
thanks for help@
Great plugin – still works fine after all these years.
Rob: see Kaf’s second example at the top of the page – you need to pass an img tag in the second argument to the the_excerpt_reloaded() function. e.g. the_excerpt_reloaded(25, ‘img’); (place tag brackets around img)
SOMEONE PLEASE ANSWER. Scrolling down these board, I’ve found three users who have all asked the same question, but all three have been ignored. Let me be the fourth to ask, and hopefully not the fourth ignored…
Is there a way to automatically display images that appear in full size in the full post as thumbnails in the excerpt? Preferably I’d like the thumbnails to automatically appear on the left side as well, a la Deadspin.com and numerous other sites.
Kaf:
First off, love the plugin, it works great! Hope you don’t mind me linking another plugin here. ;)
Jeff:
I use Post Thumbs to do that: http://theblemish.com/post-thumbs-plugin/
This plugin has been a favourite of mine for a very long time. No other plug in I have found offers this level of per template control over the excerpt.
Only trouble is – it doesn’t jive properly with with 2.5 (RC2). Specially the ‘allowedtags’ parameter no longer works – all tags are now striped out no matter what I specify.
It would be great to have this plug in working for 2.5.
Thank you!
Shaun
Hello
=========
When there is already an EXCERPT in place, I dont see a MORE LINK ?
Please HELP.
This is my smart Code:
<?php the_excerpt_reloaded(55, ‘‘, ‘content’, TRUE, ‘continue reading this post…’, FALSE, 1, TRUE); ?>
=========
Rest all GREAT
Thank you for such a great plugin.
=========
I have the more tag (
< ! -- more -- >) in my posts. The the_excerpt-reloaded in those posts goes beyond the defined lenght of the excerpt until the more tag defined in the content. how can i solve this problem?I’m having a problem using this when I embed videos in a post. Since the post is embedded simply by posting the youtube link, I end up seeing the raw link on the home page, and archive pages like this like this http://youtube.com/watch?v=MWYi4_COZMU. Is it possible to somehow get that not to show in the excerpt?
wth!? I ask for help and you delete my comment?
hi there.
i suggest the autor to add this line
$text = apply_filters( 'the_content', $text );to 101 line (after }). this will make possible working plugin with the language switcher plugin.regards, archas
Thanks for the great plugin!
Its been really useful – I’ve just finished my games reviews site (www.nometet.com) and its been brilliant; I need to display the boxart of games in the archives.
Thanks!
Thanks for the Plugin, it’s extremely helpful. Unfortunately I don’t know much about php so I was wondering if and how it is possible to point the more-Link to the category instead of the post. Help would be appreciated.
Thanks in advance.
Hi, I’m considering installing your excerpt reloaded plugin, but can you tell me if it is compatible with WordPress 2.5.1 or 2.6? Thanks.
@ Dave: I’m using it with a 2.6 installation. Working fine.
Using your plugin on wp 2.5 and it works great. Had to change a slight bit of coding as it didn’t force more links if the excerpt was too short and put in the more-link css to read display:inline so the ‘(more…)’ bit will show on the same line as the excerpt.
Absolutely a superb piece of work, but why WP doesnt have this as a standard?
hi,
I use wordpress 2.6…
do not show tag
sorry.. I wrong, tag works fine
Theres no padding in the image that shows with the text, text just touched the image,
i have set the type to content and allowed img tag, im assuming it should read the align or hspace tags that are linked with img tag?
It works fine with WP 2.6.1…Many Thanks!!
Great plugin!
But i have 2 ideas for you :)
1. Let the user decide wich element he wants for the more-link (div, span, p …)
2. Let the user define the title for the more-link with integration of the actual post title. I need this for an AAA accessibility rating :-)
I edit the two things in the plugin file.
But is there an option to define it in the parameters?
Fot future updates it would be very nice :)
I changed this fine plugin to get the links with the nofollow attribute. I just changed lines 147 und 149. There the link gets generated.
Great plugin! This is just what I needed. I have a custom WordPress home page that uses WP_Query and I could not use the default functions the_content and the_excerpt to display excerpts till I found this plugin!
excellent script! i love it, makes more sense than the default excerpt thingys in wordpress
may i ask, is it possible to allow ALL kinds of tags in the allowedtags parameter?
Marg Wegner,
I was looking for a solution to that to…what I ended up doing was modifying the cut parameter in feed.php in the_content_rss function to match the number of characters that excerpt reloaded used.
Then, I modified feed-rss2.php and replaced th_eexcerpt_rss (or was it just the_excerpt? I overwrote it so i forgot…) with the_content_rss So now it looks like this:
<![CDATA[]]>
<![CDATA[]]>
post_content ) > 0 ) : ?>
<![CDATA[]]>
<![CDATA[]]>
Hope that helps.
forgot to use the code tag:
<![CDATA[]]><![CDATA[]]>
post_content ) > 0 ) : ?>
<![CDATA[]]>
<![CDATA[]]>
nevermind, i don’t know how to shoot the code out on here but you should be able to figure it out.
Hello Kaf,
I use the plugin on nearly every blog I have set up – I think it is the best thing since sliced bread.
One thing I have noticed is that it doesn’t strip out the contents of the new wordpress shortcode (think that is what it is called – [-gallery-] and [-caption-] etc.)
Is there any chance of modifying the plugin to filter out the shortcode?
Hi!
I’m trying to understand why this plugin doesn’t work on my live blog, instead on local it work perfectly… do you have any idea why happens?
Thank you!
hello everyone
i have a need:
i own a website (www.aroundthemonde.com)
one of its sections is a wordpress blog (www.aroundthemonde.com/blog.php)
i would like to have an excerpt of the last post on the home page (with a “read more” link directing to the blog’s above url)
i just don’t know how to do that, if it’s even possible.
i’m a beginner and i’m not familiar with php coding etc… but i can follow your step by step directions if you can give me some
thank you a lot in advance
jo
Works great with WordPress 2.6 but the excerpt_length doesn’t seem to work with version 2.7.
Is there a way to make the ellipsis not show? I can’t figure it out. All I want is to have it limit to 18 words and then have a .png of an arrow used for the more link. I don’t want any text or punctuation used for the link. Is this possible with this plugin? The site I am working on is here
Removing shortcodes!
$output = preg_replace(“/\[.*?]/”, “”, $output);
This line of code will remove all shortcodes from $output. I’m not sure if it works with nested shortcodes but it definitely works with the ones created by the mp3 audio player! You can place it right before stripping the tags.. around line 122 of the plugin code!
Hey, thanx for a well working plugin… However – I would like to use the actual post title as the ‘more_link_title’. I hope to get an output to say: ‘…continue reading [the post title]. I see it is done here: http://codex.wordpress.org/Customizing_the_Read_More, but I can’t seem to get my head around how to do it with the excerpt_reloaded?
Hi Paul,
This should do the trick for you…
the_excerpt_reloaded(20, ”, ‘content_rss’, FALSE);
<a href=”" rel=”bookmark”>continue reading
Paul, couldn’t get the code to display in the comment field above – go here
Hi all.
I’d like to be able to show the img from the post as well as the custom (optional) excerpt that I wrote on the post page. I have attempted to change the filter_type to both “content” and “excerpt”, but essentially whenever I enter an optional excerpt the picture disappears. Any ideas? Cheers in advance. My current code is the_excerpt_reloaded(50, ‘img a’, ‘content’, true, ‘More…’, false);? Even with “excerpt” specified, I end up getting the first 50 characters from my post content. *yes, I have img a formated right in my code, it just won’t post here..
Does this now work with WP2.7? The length doesnt seem to change no matter what I set the parm to…. Is there an update???
Thanks first for the great work you have done. As I analyses the function, two problems are coming up:
The function –force_more_link– does not work!
I wont to use in general the more link after the text (excerpt) in one line and I use the following configuration together with WP 2.7:
the_excerpt_reloaded (50,’ ‘,’excerpt’,TRUE,’[mehr...]‘,TRUE,1,TRUE);
The second problem I wont to solve is:
The excerpted should be displayed in one line together with the more link. Is there a solution to fix this problem. The reason seems the tag after the excerpt.
Hi!
Thank you for this plugin!!!
I’m really a newbie and your description was very helpful.
Until now, i’ve got just one problem: I set the tags to be fixed, but with the em-Tag not fixed, I found half the site in italic letters. Perhaps you can add this with your next update. Thank you!
First of all thanks for making this plugin. How can I disallow IMG tags? I don’t want archives to show IMGs. Thanks.
@archas Very good fix for compliance with Language Switcher plugin. Here’s how to fix later versions:
please add $text = apply_filters( ‘the_content’, $text ); before $text = explode(‘ ‘, $text); ,which is in the ‘else’ loop.
@nahili: I tryed and I still have problems with the Language Switcher plugin.
Is it working for you?
Is only that line that needs to be added?
I think I solved the problem of -force_more not working. I changed the following:
line 113:
$more_link_text = ($force_more) ? $more_link_text : ”;
I think this must be a bug!?
I am trying to get thumbnails to display left of the excerpt. Preferably with the use of custom fields. Any suggestions why I am having such a tough time? Thanks,
Jay
PROBLEM : More link displayed on new line – SOLVED
Just replace the existing code with this one (Found at the bottom of the .php file)
if($force_more) {
$output .= 'ID) .'" title="' . $more_link_title . '">' . $more_link_text . '' . "\n";
}
I have found this plugin to be virtually indispensable for theme development, included this plugin in my article
Firstly, I’d like to say thank you for this helpful plugins.
But I have a problem with parsing the img tag. My post use this tag:
<img type="photo" src="...">does that type attribute affecting this plugin? Because the image just won’t come out.
A help would be greatly appreciated :)
This plugin rules!
I´m new in this stuff and right now I be migrate mi videogame site (own developed) to wordpress.
I want to put my images and videos in the exceprt and I combine this plugins with Vipers Video Tag. I only put this code in index.php
<?php the_excerpt_reloaded(0, '', 'content', FALSE); ?>and voala!also, in the content I put the tag “more” to cut the excerpt where I want…
thank you very much Kaf!
Hey there,
Just stopping by to say a massive thank you – I’ve been struggling with the Excerpt length for a while now, and your plugin has been a lifesaver! I needed a custom excerpt length in a particular part of my WP theme and now, thanks to this plugin, it works. Also, to let you know it works in WordPress 2.9.2 at current date. I’ll be back when I can (have you bookmarked) to donate for this.
Hi, I love this plugin, but I won’t be able to use it unless you can tell me how to allow embedded videos in the excerpt. This question has been asked a few times above, but I don’t see an answer yet. Please help!
~Josh
Hi. Nice work, thank you. You may want to consider a delimiter to be used instead of number of words.
That would allow for way more flexible excerpts or varrying lengths.
You’re the man!
After an allnighter which tought me more about css, wp, and php than I ever wanted to know AND about two hours searching, trying and begging for a solution for images showing up in the sidebar of my design your plugin did it! Thanks so much.
An on …
PS: If you’re ever in Leipzig, Germany, I owe you a beer! Cheers!
HI. I have the same query as Josh – is there a way to allow embedded videos in the excerpt? I’ve been struggling with this. I’m not a code junkie!
Hi. Nice work, thank you. You may want to consider a delimiter to be used instead of number of words.
That would allow for way more flexible excerpts or varrying lengths.
“I have the same query as Josh – is there a way to allow embedded videos in the excerpt? I’ve been struggling with this. I’m not a code junkie!”
I actually am struggling with this as well. I want to embed videos but I’m not sure how to make it work. I’m also new to this!
I have a problem with the plugin.
If I insert an image before the text, the plugin counts the words used for imaging.
example:
img href=”…” /img text text text
Count the words img href etc. … so if I want to see the septum 3 words I do not display them.
Is there a way to make sure that the plugin does not count the words contained in the tag “img”?