CINXE.COM

Excerpt or Content Word Limit in WordPress: Redux | bavotasan.com

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US"><head><script type="text/javascript" src="/_static/js/bundle-playback.js?v=HxkREWBo" charset="utf-8"></script> <script type="text/javascript" src="/_static/js/wombat.js?v=txqj7nKC" charset="utf-8"></script> <script>window.RufflePlayer=window.RufflePlayer||{};window.RufflePlayer.config={"autoplay":"on","unmuteOverlay":"hidden"};</script> <script type="text/javascript" src="/_static/js/ruffle/ruffle.js"></script> <script type="text/javascript"> __wm.init("https://web.archive.org/web"); __wm.wombat("http://bavotasan.com:80/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?","20100704091800","https://web.archive.org/","web","/_static/", "1278235080"); </script> <link rel="stylesheet" type="text/css" href="/_static/css/banner-styles.css?v=S1zqJCYt" /> <link rel="stylesheet" type="text/css" href="/_static/css/iconochive.css?v=3PDvdIFv" /> <!-- End Wayback Rewrite JS Include --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><meta name="googlebot" content="index,archive,follow,noodp"/><meta name="robots" content="all,index,follow"/><meta name="msnbot" content="all,index,follow"/><meta name="description" content="This is just a revamp of a function I wrote a while back to add the ability to limit the number of words displayed when you call the excerpt or content. As..."/><meta name="keywords" content="ability,Array,code,code hacking,content,Content Limit,Content Word,Content word limit,count,excerpt,Excerpt word limit,Function,img,implode,limit,Lt,max,max number,num,number,pop,Preg,Programmers,programming,return,theContent,the_content,the_excerpt,way,while,Word Limit,WordPress,WordPress hack,"/><title>Excerpt or Content Word Limit in WordPress: Redux | bavotasan.com</title><link rel="stylesheet" href="https://web.archive.org/web/20100704091800cs_/http://bavotasan.com/wp-content/themes/bavotasan_new/style.css" type="text/css" media="screen"/><link rel="alternate" type="application/rss+xml" title="bavotasan.com RSS Feed" href="https://web.archive.org/web/20100704091800/http://feeds.feedburner.com/bavotasan"/><link rel="pingback" href="http://bavotasan.com/xmlrpc.php"/> <!--[if IE]><link rel="stylesheet" type="text/css" href="http://bavotasan.com/wp-content/themes/bavotasan_new/iestyles.css" /> <![endif]--> <!--[if IE 8]><link rel="stylesheet" type="text/css" href="http://bavotasan.com/wp-content/themes/bavotasan_new/iestyles8.css" /> <![endif]--><link rel="canonical" href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/"/><link rel="alternate" type="application/rss+xml" title="bavotasan.com 禄 Excerpt or Content Word Limit in WordPress: Redux Comments Feed" href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/feed/"/><link rel="stylesheet" id="A2A_SHARE_SAVE-css" href="https://web.archive.org/web/20100704091800cs_/http://bavotasan.com/wp-content/plugins/add-to-any/addtoany.min.css?ver=1.0" type="text/css" media="all"/> <script type="text/javascript" src="https://web.archive.org/web/20100704091800js_/http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js?ver=1.4.2"></script> <link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://bavotasan.com/xmlrpc.php?rsd"/><link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://bavotasan.com/wp-includes/wlwmanifest.xml"/><link rel="index" title="bavotasan.com" href="http://bavotasan.com/"/><link rel="start" title="Removing Images from a WordPress Post: Redux" href="http://bavotasan.com/tutorials/removing-images-from-a-wordpress-post/"/><link rel="prev" title="Removing Images from a WordPress Post: Redux" href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/removing-images-from-a-wordpress-post/"/><link rel="next" title="Excerpt and Content Word Limit WordPress Plugin" href="https://web.archive.org/web/20100704091800/http://bavotasan.com/downloads/excerpt-and-content-word-limit-wordpress-plugin/"/><link rel="canonical" href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/"/><link rel="shortlink" href="https://web.archive.org/web/20100704091800/http://wp.me/pmjlM-4l"/> <!--[if IE]><style type="text/css">ul.addtoany_list a img{filter:alpha(opacity=70)}ul.addtoany_list a:hover img,ul.addtoany_list a.addtoany_share_save img{filter:alpha(opacity=100)}</style><![endif]--> <script type="text/javascript" src="https://web.archive.org/web/20100704091800js_/http://ajax.googleapis.com/ajax/libs/swfobject/2.1/swfobject.js"></script> </head><body> <script type="text/javascript">(function(){var bsa=document.createElement('script');bsa.type='text/javascript';bsa.async=true;bsa.src='//web.archive.org/web/20100704091800/http://s3.buysellads.com/ac/bsa.js';(document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(bsa);})();</script> <div id="topmenu"><ul><li><a href="https://web.archive.org/web/20100704091800/http://themes.bavotasan.com/" title="Themes by bavotasan.com">Themes by bavotasan.com</a></li><li><a href="https://web.archive.org/web/20100704091800/http://support.bavotasan.com/" title="Support Forum">Support Forum</a></li><li><a href="https://web.archive.org/web/20100704091800/http://themes.bavotasan.com/affiliates" title="Affiliates">Affiliates</a></li><li class="page_item page-item-1956"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/free-premium-theme/" title="Get a Premium Theme for FREE">Get a Premium Theme for FREE</a></li><li class="page_item page-item-943"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/about/" title="About">About</a></li><li class="page_item page-item-75"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/services/" title="Services">Services</a></li><li class="page_item page-item-12"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/contact/" title="Contact">Contact</a></li></ul></div><div id="header"><div id="title"> <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/" class="bavotasan-logo"></a></div><p id="desc">bavotasan.com&nbsp;by c.bavota</p><div id="navigation"><ul><li><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/">Home</a></li><li class="cat-item cat-item-1 current-cat70"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/category/articles/" title="View all posts filed under Articles">Articles</a></li><li class="cat-item cat-item-671"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/category/downloads/" title="View all posts filed under Downloads">Downloads</a></li><li class="cat-item cat-item-1 current-cat"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/category/tutorials/" title="View all posts filed under Tutorials">Tutorials</a></li></ul></div> <a href="https://web.archive.org/web/20100704091800/http://feeds.feedburner.com/bavotasan" id="newrss"></a></div><div id="mainwrapper"><div class="topround"></div><div id="content"><div id="leftcontent"><div class="post"><h1>Excerpt or Content Word Limit in WordPress: Redux</h1><div class="thedate"><span>Posted on February 16, 2009&nbsp;&nbsp;|&nbsp;&nbsp;Category: <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/category/tutorials/" title="View all posts in Tutorials" rel="category tag">Tutorials</a></span></div><p>This is just a revamp of a function I wrote a while back to add the ability to limit the number of words displayed when you call the excerpt or content. As it stands, the max number of words for the excerpt is 55. There is a new function with WP 2.9 to increase this number. Check out <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/?p=1393">Quick &#038; Easy Excerpt Mods Coming in WordPress 2.9</a> for more on that subject.<br/> <span id="more-269"></span><br/> Add the following code to your functions.php file.</p><div class="wp_syntax"><table border="0" cellpadding="0" cellspacing="0"><tr><td class="line_numbers"><pre>1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 </pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> excerpt<span style="color: #009900;">&#40;</span><span style="color: #000088;">$limit</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000088;">$excerpt</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span> get_the_excerpt<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$limit</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$excerpt</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&gt;=</span><span style="color: #000088;">$limit</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #990000;">array_pop</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$excerpt</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$excerpt</span> <span style="color: #339933;">=</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$excerpt</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'...'</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #000088;">$excerpt</span> <span style="color: #339933;">=</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$excerpt</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #000088;">$excerpt</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'`\[[^\]]*\]`'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #000088;">$excerpt</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">return</span> <span style="color: #000088;">$excerpt</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> &nbsp; <span style="color: #000000; font-weight: bold;">function</span> content<span style="color: #009900;">&#40;</span><span style="color: #000088;">$limit</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span> get_the_content<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$limit</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&gt;=</span><span style="color: #000088;">$limit</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #990000;">array_pop</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'...'</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/\[.+\]/'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> apply_filters<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_content'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">']]&gt;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">']]&amp;gt;'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">return</span> <span style="color: #000088;">$content</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span></pre></td></tr></table></div><p>Now, instead of using the_content() or the_excerpt in your loop, use excerpt($limit) or content($limit).</p><p>If you want to limit your excerpt to 25 words the code would look like this:</p><div class="wp_syntax"><table border="0" cellpadding="0" cellspacing="0"><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> excerpt<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">25</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></td></tr></table></div><p>I also created a plugin for this that you can download at <a href="https://web.archive.org/web/20100704091800/http://wordpress.org/extend/plugins/content-and-excerpt-word-limit/">http://wordpress.org/extend/plugins/content-and-excerpt-word-limit/</a>.</p> <br style="clear:both;"/><hr class="clear"/><p class="tags">Tags: <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tag/ability/" rel="tag">ability</a>, <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tag/array/" rel="tag">Array</a>, <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tag/code/" rel="tag">code</a>, <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tag/code-hacking/" rel="tag">code hacking</a>, <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tag/content/" rel="tag">content</a>, <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tag/content-limit/" rel="tag">Content Limit</a>, <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tag/content-word/" rel="tag">Content Word</a>, <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tag/content-word-limit/" rel="tag">Content word limit</a>, <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tag/count/" rel="tag">count</a>, <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tag/excerpt/" rel="tag">excerpt</a>, <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tag/excerpt-word-limit/" rel="tag">Excerpt word limit</a>, <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tag/function/" rel="tag">Function</a>, <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tag/img/" rel="tag">img</a>, <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tag/implode/" rel="tag">implode</a>, <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tag/limit/" rel="tag">limit</a>, <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tag/lt/" rel="tag">Lt</a>, <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tag/max/" rel="tag">max</a>, <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tag/max-number/" rel="tag">max number</a>, <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tag/num/" rel="tag">num</a>, <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tag/number/" rel="tag">number</a>, <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tag/pop/" rel="tag">pop</a>, <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tag/preg/" rel="tag">Preg</a>, <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tag/programmers/" rel="tag">Programmers</a>, <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tag/programming/" rel="tag">programming</a>, <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tag/return/" rel="tag">return</a>, <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tag/thecontent/" rel="tag">theContent</a>, <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tag/the_content/" rel="tag">the_content</a>, <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tag/the_excerpt/" rel="tag">the_excerpt</a>, <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tag/way/" rel="tag">way</a>, <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tag/while/" rel="tag">while</a>, <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tag/word-limit/" rel="tag">Word Limit</a>, <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tag/wordpress/" rel="tag">WordPress</a>, <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tag/wordpress-hack/" rel="tag">WordPress hack</a></p><p class="tags">Short URL: <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/?p=269" title="Excerpt or Content Word Limit in WordPress: Redux">http://bavotasan.com/?p=269</a></p></div><div id="bsap_1248153" class="bsarocks bsap_8982c17d635c33dbe23a7ef930777c37"></div><div class="lowerposts"><div class="leftlower"><h3>Did you like this?</h3><div class="rss"></div><a href="https://web.archive.org/web/20100704091800/http://feeds.feedburner.com/bavotasan">Subscribe and get the latest</a><br/> <a class="a2a_dd addtoany_share_save" href="https://web.archive.org/web/20100704091800/http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fbavotasan.com%2Ftutorials%2Flimiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress%2F&amp;linkname=Excerpt%20or%20Content%20Word%20Limit%20in%20WordPress%3A%20Redux"><img src="https://web.archive.org/web/20100704091800im_/http://bavotasan.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> <script type="text/javascript">var a2a_config=a2a_config||{};a2a_config.linkname="Excerpt or Content Word Limit in WordPress: Redux";a2a_config.linkurl="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/";</script><script type="text/javascript" src="https://web.archive.org/web/20100704091800js_/http://static.addtoany.com/menu/page.js"></script> <div class="share"> <script src="https://web.archive.org/web/20100704091800js_/http://digg.com/tools/diggthis.js" type="text/javascript"></script> <div class="tweet"><script type="text/javascript" src="https://web.archive.org/web/20100704091800js_/http://tweetmeme.com/i/scripts/button.js"></script></div></div></div><div class="rightlower"><div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/downloads/excerpt-and-content-word-limit-wordpress-plugin/" rel="bookmark" class="crp_title">Excerpt and Content Word Limit WordPress Plugin</a></li><li><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/quick-easy-excerpt-mods-coming-in-wordpress-2-9/" rel="bookmark" class="crp_title">Quick &#038; Easy Excerpt Mods Coming in WordPress 2.9</a></li><li><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/retrieve-the-first-image-from-a-wordpress-post/" rel="bookmark" class="crp_title">Retrieve and Display Images from a WordPress Post</a></li><li><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/how-to-remove-the-links-to-parent-pages-in-the-wordpress-page-list/" rel="bookmark" class="crp_title">How to Remove the Links to Parent Pages in the WordPress Page List</a></li><li><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/quick-function-shorten-post-title-wordpress/" rel="bookmark" class="crp_title">Quick Function to Shorten the Post Title in WordPress</a></li></ul></div></div></div><div id="postcomments"> <a href="#comment_list"></a><h3 id="comments">63 Responses to &#8220;Excerpt or Content Word Limit in WordPress: Redux&#8221;</h3><div class="navigation"><div class="alignleft"></div><div class="alignright"></div></div><ol class="commentlist"><li class="comment even thread-even depth-1" id="li-comment-589"><div id="comment-589"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://1.gravatar.com/avatar/df5e040a0473a1286109e543bf99c814?s=36&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn">Thassager</cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-589"> March 8, 2009 at 12:55 pm</a></div><p>Hi,<br/> Magazine Basic a very nice template, but I&#8217;d like to remove the excerpt/word limit funktion, but I&#8217;m not sure how to do this.<br/> I&#8217;d like to be able to show the full post rather than the excerpt. Is this possible? And secondly &#8211; I&#8217;m not too familiar with coding, so would it be possible to get info on as to what I should change.<br/> Thanks!</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=589#respond" onclick="return addComment.moveForm(&quot;comment-589&quot;, &quot;589&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#589</div></div><ul class="children"><li class="comment byuser bypostauthor odd alt depth-2" id="li-comment-604"><div id="comment-604"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/0375e723bd400a99acb6f2e08d6ea190?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://tinkerpriestmedia.com/" rel="external nofollow" class="url">c.bavota</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-604"> March 9, 2009 at 5:22 pm</a></div><p>Hello Thassager,</p><p>In the newest version of the theme (2.3), just go to index.php and look for theme_excerpt() and getImage(). There should be three instances. Delete getImage() and replace theme_excerpt() with the_content() and that should do it.</p><div class="commentnumber">#604</div></div></li></ul></li><li class="comment even thread-odd thread-alt depth-1" id="li-comment-1619"><div id="comment-1619"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/0287679ff5005c89b7737ca2d7405e40?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://www.bare.bz/" rel="external nofollow" class="url">Chris</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-1619"> April 8, 2009 at 9:31 am</a></div><p>Ah very good, was looking all over how to do this. Can a link to the content in question be included ?</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=1619#respond" onclick="return addComment.moveForm(&quot;comment-1619&quot;, &quot;1619&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#1619</div></div></li><li class="comment odd alt thread-even depth-1" id="li-comment-1676"><div id="comment-1676"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/47cd2e69bec0bd0b7afd44ca24f02917?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn">Peter</cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-1676"> April 9, 2009 at 11:06 pm</a></div><p>Hi, is there anyway to increase the limit higher than 55?</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=1676#respond" onclick="return addComment.moveForm(&quot;comment-1676&quot;, &quot;1676&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#1676</div></div><ul class="children"><li class="comment even depth-2" id="li-comment-2239"><div id="comment-2239"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/841e3e3bb1e83f7d05c80ccdb2618c52?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://www.100and8.com/" rel="external nofollow" class="url">Shane</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-2239"> May 6, 2009 at 7:44 pm</a></div><p>I&#8217;m also curious if there is a way to increase the limit. Also, is it possible to include the entire post for the &#8220;Latest Story&#8221; and put a limit on the older posts?</p><div class="commentnumber">#2239</div></div></li><li class="comment odd alt depth-2" id="li-comment-2986"><div id="comment-2986"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://1.gravatar.com/avatar/57b3a9fcff9db18e4e4585923ef130ef?s=36&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn">Jason</cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-2986"> June 20, 2009 at 2:13 am</a></div><p>First, thanks for a great theme &#8211; excellent job!</p><p>I, too, am interested in increasing the excerpt limit from 55 to something a bit higher. I have gone through the php code, and made several changes to no avail (now backed out) in an attempt to raise the value. I have also tried replacing theme<em>excerpt() with the</em>content() in index.php as suggested above (to Thassager) just to remove the excerpts entirely (seems the underscore characters in this paragraph might be being filtered, FYI).</p><p>I&#8217;m just wanting the entire post to appear when a category is selected from the menu without having to click twice. I&#8217;m running 2.3.3 at present. Should I stay with this version or update to 2.4.9 and try to make the changes to that instead?</p><p>Any thoughts/help/guidance appreciated. Again, thanks.</p><p>Regards,<br/> Jason</p><div class="commentnumber">#2986</div></div></li></ul></li><li class="comment even thread-odd thread-alt depth-1" id="li-comment-2064"><div id="comment-2064"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://1.gravatar.com/avatar/f5a3649e6c6c6a9aee13d32b3d30e01b?s=36&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://www.get-involved.org/" rel="external nofollow" class="url">Andrew MacRae</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-2064"> April 22, 2009 at 3:09 pm</a></div><p>Fantastic work on this, however, I have not got it to work yet. Could I get a little more advice as to where this needs to go in the functions.php theme file?</p><p>Regards</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=2064#respond" onclick="return addComment.moveForm(&quot;comment-2064&quot;, &quot;2064&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#2064</div></div><ul class="children"><li class="comment byuser bypostauthor odd alt depth-2" id="li-comment-2094"><div id="comment-2094"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/0375e723bd400a99acb6f2e08d6ea190?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://tinkerpriestmedia.com/" rel="external nofollow" class="url">c.bavota</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-2094"> April 23, 2009 at 11:23 am</a></div><p>Place it anywhere between <code>&lt;?php</code> and <code>?&gt;</code>.</p><div class="commentnumber">#2094</div></div></li></ul></li><li class="comment even thread-even depth-1" id="li-comment-2207"><div id="comment-2207"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://1.gravatar.com/avatar/1fa6e0152b61f4ddb410ce8d109757d3?s=36&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn">David</cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-2207"> May 1, 2009 at 11:17 am</a></div><p>You&#8217;re a genius! Brilliant plugin.</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=2207#respond" onclick="return addComment.moveForm(&quot;comment-2207&quot;, &quot;2207&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#2207</div></div></li><li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-2382"><div id="comment-2382"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://1.gravatar.com/avatar/527878d219dce938a1e44591a157c4a6?s=36&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn">Christina</cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-2382"> May 22, 2009 at 12:13 pm</a></div><p>Very cool plugin! Just as cool as Magazine Columns. Unfortunately they seem not to work together. Is there a way to merge both functions? I would really appreciate your advice because these plugins combined would save my current project&#8230; Help! Pleeease!!!!</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=2382#respond" onclick="return addComment.moveForm(&quot;comment-2382&quot;, &quot;2382&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#2382</div></div></li><li class="comment even thread-even depth-1" id="li-comment-2563"><div id="comment-2563"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/e6e847eaea075a403a78260d0ebc5813?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://www.udyr.com/" rel="external nofollow" class="url">Patrick</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-2563"> June 1, 2009 at 4:14 pm</a></div><p>How do i also exclude the &lt; b &gt; (bold) tag from posts?</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=2563#respond" onclick="return addComment.moveForm(&quot;comment-2563&quot;, &quot;2563&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#2563</div></div></li><li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-3210"><div id="comment-3210"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/ad3dc4a920ed4d2a9b6157e799bc67ae?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://www.brokencode.com/" rel="external nofollow" class="url">brokencode</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-3210"> July 4, 2009 at 6:17 pm</a></div><p>that&#8217;s simple? thank you so much. Thought I need a plugin before. Wave the plugin now, it&#8217;s just need 17 lines <img src="https://web.archive.org/web/20100704091800im_/http://bavotasan.com/wp-includes/images/smilies/icon_biggrin.gif" alt=":D" class="wp-smiley"/></p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=3210#respond" onclick="return addComment.moveForm(&quot;comment-3210&quot;, &quot;3210&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#3210</div></div></li><li class="comment even thread-even depth-1" id="li-comment-3315"><div id="comment-3315"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://1.gravatar.com/avatar/113d15a9fd0682e2599a79cbeed91b1f?s=36&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://www.intuitivedesigns.net/" rel="external nofollow" class="url">Naomi Niles</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-3315"> July 13, 2009 at 2:59 am</a></div><p>Nice! I tried the <a href="https://web.archive.org/web/20100704091800/http://codex.wordpress.org/Template_Tags/the_excerpt" rel="nofollow">method on the WordPress site</a> to shorten the excerpt and it didn&#8217;t work. I love how you can control each one individually this way too. Thanks!!</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=3315#respond" onclick="return addComment.moveForm(&quot;comment-3315&quot;, &quot;3315&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#3315</div></div><ul class="children"><li class="comment odd alt depth-2" id="li-comment-3438"><div id="comment-3438"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://1.gravatar.com/avatar/18d8e903635c29bdc1dcc31f448bbb8d?s=36&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://www.intuitivedesigns.net/" rel="external nofollow" class="url">Naomi Niles</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-3438"> July 23, 2009 at 5:38 pm</a></div><p>Argh, it was working until I updated to WP 2.8.2 . Anyone know of a way to work around that?</p><div class="commentnumber">#3438</div></div></li><li class="comment byuser bypostauthor even depth-2" id="li-comment-3467"><div id="comment-3467"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/0375e723bd400a99acb6f2e08d6ea190?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://tinkerpriestmedia.com/" rel="external nofollow" class="url">c.bavota</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-3467"> July 27, 2009 at 7:55 am</a></div><p>Hmm. I am using a version I have modified slightly on 2.8.x and it still works. Try this.</p><div class="wp_syntax"><table border="0" cellpadding="0" cellspacing="0"><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> theme_excerpt<span style="color: #009900;">&#40;</span><span style="color: #000088;">$num</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">55</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000088;">$link</span> <span style="color: #339933;">=</span> get_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$limit</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$num</span><span style="color: #339933;">;</span> <span style="color: #000088;">$excerpt</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span> <span style="color: #990000;">strip_tags</span><span style="color: #009900;">&#40;</span>get_the_excerpt<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$limit</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$excerpt</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&gt;=</span><span style="color: #000088;">$limit</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #990000;">array_pop</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$excerpt</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$excerpt</span> <span style="color: #339933;">=</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$excerpt</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'...'</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #000088;">$excerpt</span> <span style="color: #339933;">=</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$excerpt</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #000088;">$excerpt</span> <span style="color: #339933;">=</span> apply_filters<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_content'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$excerpt</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$excerpt</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'`\[[^\]]*\]`'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #000088;">$excerpt</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;p&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$excerpt</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/p&gt;'</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span></pre></div></td></tr></table></div><div class="commentnumber">#3467</div></div></li></ul></li><li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-3495"><div id="comment-3495"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://1.gravatar.com/avatar/5fa6665d6b1cb987604e22aa13871574?s=36&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://folkspants.com/" rel="external nofollow" class="url">ross chapman</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-3495"> July 28, 2009 at 6:24 pm</a></div><p>so anyway to keep formatting tags (ie <code>&lt;p&gt;&lt;/p&gt;</code>) in the new output? thanks for the advice. i&#8217;m using your plugin on 2.8.</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=3495#respond" onclick="return addComment.moveForm(&quot;comment-3495&quot;, &quot;3495&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#3495</div></div></li><li class="comment even thread-even depth-1" id="li-comment-3796"><div id="comment-3796"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/0a0719e34ad670aaec2f438310cfbfc3?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn">sze jia</cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-3796"> August 12, 2009 at 1:31 pm</a></div><p>How do i limit the words in my content in WP 2.8.2?</p><p>The plugin doesn&#8217;t seem to be working for me! <img src="https://web.archive.org/web/20100704091800im_/http://bavotasan.com/wp-includes/images/smilies/icon_sad.gif" alt=":(" class="wp-smiley"/></p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=3796#respond" onclick="return addComment.moveForm(&quot;comment-3796&quot;, &quot;3796&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#3796</div></div></li><li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-4066"><div id="comment-4066"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://1.gravatar.com/avatar/55267083cf9fec1da06170f8ef4b0853?s=36&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn">Baban</cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-4066"> August 29, 2009 at 3:58 pm</a></div><p>Sorry. Trying again. In WP 2.8.4, use</p><p><strong>theme&#95;excerpt</strong> and not just <strong>excerpt</strong></p><p>in the code <code>&lt;? php excerpt('25'); ?&gt;</code></p><p>It worked for me.</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=4066#respond" onclick="return addComment.moveForm(&quot;comment-4066&quot;, &quot;4066&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#4066</div></div><ul class="children"><li class="comment even depth-2" id="li-comment-5879"><div id="comment-5879"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://1.gravatar.com/avatar/14a0b06fbe38282014ded52f23562ac7?s=36&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn">Matt</cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-5879"> November 3, 2009 at 10:10 am</a></div><p>Remove the space between &lt;? and php</p><div class="commentnumber">#5879</div></div></li></ul></li><li class="comment odd alt thread-even depth-1" id="li-comment-6574"><div id="comment-6574"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/2812ce44b0d18d561a42bc5b1ac60980?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://travisfarnes.com/" rel="external nofollow" class="url">Travis Farnes</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-6574"> December 2, 2009 at 6:55 pm</a></div><p>I too would like to know how I can keep the paragraph formatting tags.</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=6574#respond" onclick="return addComment.moveForm(&quot;comment-6574&quot;, &quot;6574&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#6574</div></div><ul class="children"><li class="comment even depth-2" id="li-comment-6667"><div id="comment-6667"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/282d2a0f1986986f912f2eb3d66ecee7?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://webtolerant.com/" rel="external nofollow" class="url">Amey</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-6667"> December 8, 2009 at 6:12 am</a></div><p>Just ad around the</p><div class="commentnumber">#6667</div></div></li><li class="comment odd alt depth-2" id="li-comment-6668"><div id="comment-6668"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/282d2a0f1986986f912f2eb3d66ecee7?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://webtolerant.com/" rel="external nofollow" class="url">Amey</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-6668"> December 8, 2009 at 6:13 am</a></div><p>just had the paragraph tag around the code</p><div class="commentnumber">#6668</div></div></li></ul></li><li class="comment even thread-odd thread-alt depth-1" id="li-comment-6883"><div id="comment-6883"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://1.gravatar.com/avatar/5fd42017656fe50a60ced98710d0dbd6?s=36&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://bmddesigns.com/" rel="external nofollow" class="url">BMD</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-6883"> December 22, 2009 at 5:21 pm</a></div><p>Just would like to say after trying a bunch of codes for the functions file and none of them working, yours worked the first time and I love it! Thanks!!</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=6883#respond" onclick="return addComment.moveForm(&quot;comment-6883&quot;, &quot;6883&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#6883</div></div></li><li class="comment odd alt thread-even depth-1" id="li-comment-6940"><div id="comment-6940"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://1.gravatar.com/avatar/f5e789b2b75c42b109dab265927045ff?s=36&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://www.talgalili.com/" rel="external nofollow" class="url">Tal Galili</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-6940"> December 31, 2009 at 3:46 pm</a></div><p>Hi there,<br/> I love your code, but would like your help:<br/> I wish to display only X number of words, but to keep ALL the formatting around them (e.g: the <b> and so on)</p><p>Using</p><p>Wouldn&#8217;t do it.</p><p>Any other advice?<br/> Thanks !</p><p>(p.s: consider adding the plugin &#8220;subscribe to comments&#8221;<br/> Best,<br/> Tal)</b></p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=6940#respond" onclick="return addComment.moveForm(&quot;comment-6940&quot;, &quot;6940&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#6940</div></div></li><li class="comment even thread-odd thread-alt depth-1" id="li-comment-6997"><div id="comment-6997"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/048fca33204ee35d6834137aed770281?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn">Charmed</cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-6997"> January 6, 2010 at 1:15 am</a></div><p>Hello, this function is terrific.</p><p>I am interested this additional question:</p><p>Is there a way to replace the [...] with a permalink to the post?</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=6997#respond" onclick="return addComment.moveForm(&quot;comment-6997&quot;, &quot;6997&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#6997</div></div><ul class="children"><li class="comment odd alt depth-2" id="li-comment-6998"><div id="comment-6998"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/048fca33204ee35d6834137aed770281?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn">Charmed</cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-6998"> January 6, 2010 at 1:28 am</a></div><p>I figured out a work around to my question, simply by removing the &#8230; from the function, so line 15 looks like:</p><p>$content = implode(&#8221; &#8220;,$content).&#8221; &#8220;;</p><p>and using the permalink in the template instead. Thanks!</p><div class="commentnumber">#6998</div></div></li><li class="comment byuser bypostauthor even depth-2" id="li-comment-7064"><div id="comment-7064"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/0375e723bd400a99acb6f2e08d6ea190?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/" rel="external nofollow" class="url">c.bavota</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-7064"> January 11, 2010 at 11:33 am</a></div><p>Also check out the new functions in WordPress 2.9 that allow you to modify the excerpt core function.</p><p><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/quick-easy-excerpt-mods-coming-in-wordpress-2-9/" rel="nofollow">http://bavotasan.com/tutorials/quick-easy-excerpt-mods-coming-in-wordpress-2-9/</a></p><div class="commentnumber">#7064</div></div></li></ul></li><li class="comment odd alt thread-even depth-1" id="li-comment-7233"><div id="comment-7233"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://1.gravatar.com/avatar/b1e5a6bbba1f069546e60aca15614ed4?s=36&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn">Stuart</cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-7233"> January 22, 2010 at 10:22 am</a></div><p>Thanks for the info&#8230;works perfectly for what I need!</p><p>Cheers<br/> Stu</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=7233#respond" onclick="return addComment.moveForm(&quot;comment-7233&quot;, &quot;7233&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#7233</div></div></li><li class="comment even thread-odd thread-alt depth-1" id="li-comment-7256"><div id="comment-7256"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://1.gravatar.com/avatar/bc2cef6829ab2b342dfa5a652de05a65?s=36&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://www.paulburddesign.com/" rel="external nofollow" class="url">paul</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-7256"> January 24, 2010 at 12:09 am</a></div><p>AWESOME! Thank you so much. The code works great in WP 2.9.1. It&#8217;s way better than the new function WP provides as it allows you to have different word counts on different pages.</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=7256#respond" onclick="return addComment.moveForm(&quot;comment-7256&quot;, &quot;7256&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#7256</div></div></li><li class="comment odd alt thread-even depth-1" id="li-comment-7291"><div id="comment-7291"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://1.gravatar.com/avatar/5fea71e035a5365915ad84f625ada07e?s=36&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://danielstrongwater.com/" rel="external nofollow" class="url">Dan</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-7291"> January 25, 2010 at 8:39 pm</a></div><p>Here&#8217;s a function based off of c.bavota&#8217;s to limit the number of characters as opposed to words. Example below is to return a shortened title. Should you want to shorten the excerpt or content by character count as opposed to word count just replace all the &#8216;title&#8217; with &#8216;content&#8217; or &#8216;excerpt&#8217; respectively.</p><p>Also added in an if clause so it doesn&#8217;t add the &#8230; if its not longer than your specified character length.</p><p>Works in wordpress 2.9.1</p><p>Enjoy!</p><div class="wp_syntax"><table border="0" cellpadding="0" cellspacing="0"><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> short_title<span style="color: #009900;">&#40;</span><span style="color: #000088;">$num</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000088;">$limit</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$num</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> <span style="color: #000088;">$title</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_split</span><span style="color: #009900;">&#40;</span>get_the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$length</span> <span style="color: #339933;">=</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$title</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$length</span><span style="color: #339933;">&gt;=</span><span style="color: #000088;">$num</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000088;">$title</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_slice</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$title</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$num</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$title</span> <span style="color: #339933;">=</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$title</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;...&quot;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$title</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#125;</span></pre></div></td></tr></table></div><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=7291#respond" onclick="return addComment.moveForm(&quot;comment-7291&quot;, &quot;7291&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#7291</div></div><ul class="children"><li class="comment byuser bypostauthor even depth-2" id="li-comment-7320"><div id="comment-7320"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/0375e723bd400a99acb6f2e08d6ea190?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/" rel="external nofollow" class="url">c.bavota</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-7320"> January 27, 2010 at 1:27 am</a></div><p>Very nice. Thanks for the code snippet.</p><div class="commentnumber">#7320</div></div></li></ul></li><li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-7344"><div id="comment-7344"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/e895d6c1a7fc464a1cd3a29551279897?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://unsungcinema.com/" rel="external nofollow" class="url">Cody</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-7344"> January 27, 2010 at 8:56 pm</a></div><p>I know very little about PHP, and probably shouldn&#8217;t be messing with the code, but I really want to get this feature working on the site I&#8217;m building.</p><p>The thing I&#8217;m worried about is that the excerpt I&#8217;m trying to limit is not from the default text submission. I&#8217;m using the &#8220;Tubular&#8221; theme from StudioPress, and only the embedded video goes into the main &#8220;Edit Post&#8221; text box. The text goes into a custom text editor which appears below the main one when writing a new post. So my question is: what can I do to make this code work for this custom thingie. Here&#8217;s the snippet of code that&#8230;erm&#8230;echoes?&#8230;the content I&#8217;m trying to limit:</p><p><a href="https://web.archive.org/web/20100704091800/http://img39.imageshack.us/img39/201/codee.jpg" rel="nofollow">http://img39.imageshack.us/img39/201/codee.jpg</a></p><p>After I add the code to the functions document, do I just replace this code with something? If you go to my site, (don&#8217;t judge, it&#8217;s a work in progress), you can see how the &#8220;Newsies&#8221; review absolutely needs to be limited. Thanks for any help. <img src="https://web.archive.org/web/20100704091800im_/http://bavotasan.com/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley"/></p><p>(FYI, the name of the custom text thingie is video description, which is why I assumed this was the part of the code I would have to replace.)</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=7344#respond" onclick="return addComment.moveForm(&quot;comment-7344&quot;, &quot;7344&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#7344</div></div><ul class="children"><li class="comment byuser bypostauthor even depth-2" id="li-comment-7358"><div id="comment-7358"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/0375e723bd400a99acb6f2e08d6ea190?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/" rel="external nofollow" class="url">c.bavota</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-7358"> January 28, 2010 at 3:28 pm</a></div><p>You can replace this line:</p><div class="wp_syntax"><table border="0" cellpadding="0" cellspacing="0"><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$excerpt</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span> get_the_excerpt<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$limit</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></td></tr></table></div><p>with this:</p><div class="wp_syntax"><table border="0" cellpadding="0" cellspacing="0"><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$excerpt</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span> get_post_meta<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;_video_description&quot;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$limit</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></td></tr></table></div><p>And that should work for you.</p><div class="commentnumber">#7358</div></div></li></ul></li><li class="comment odd alt thread-even depth-1" id="li-comment-7362"><div id="comment-7362"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://1.gravatar.com/avatar/dc34f37b6469442d461808b1092c7fe1?s=36&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn">archer</cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-7362"> January 28, 2010 at 7:16 pm</a></div><p>really need to get this working..<br/> if a number of words in the content is less than the limit set.. it last word is being cut off.</p><p>For the instance, if my full content is &#8220;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc nunc lorem, interdum viverra pretium&#8221;<br/> the result is &#8220;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc nunc lorem, interdum viverra&#8230;&#8221;</p><p>how would i solve this. anyone? really need a quick help..</p><p>btw&#8230; thanks for the function.. its awesome.. just have to fix this one issue</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=7362#respond" onclick="return addComment.moveForm(&quot;comment-7362&quot;, &quot;7362&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#7362</div></div><ul class="children"><li class="comment byuser bypostauthor even depth-2" id="li-comment-7368"><div id="comment-7368"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/0375e723bd400a99acb6f2e08d6ea190?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/" rel="external nofollow" class="url">c.bavota</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-7368"> January 29, 2010 at 1:24 am</a></div><p>I just revamped it above, so check it out.</p><div class="commentnumber">#7368</div></div></li></ul></li><li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-7423"><div id="comment-7423"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://1.gravatar.com/avatar/752225205a9b6a525ea2fa8e524ece58?s=36&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn">Mark</cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-7423"> January 31, 2010 at 12:02 am</a></div><p>How do I display a read more link that I can also style using CSS?</p><p>I&#8217;ve tried a few things and it hasn&#8217;t worked.</p><p>I hope to find the advice i need thanks everyone.</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=7423#respond" onclick="return addComment.moveForm(&quot;comment-7423&quot;, &quot;7423&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#7423</div></div><ul class="children"><li class="comment byuser bypostauthor even depth-2" id="li-comment-7433"><div id="comment-7433"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/0375e723bd400a99acb6f2e08d6ea190?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/" rel="external nofollow" class="url">c.bavota</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-7433"> January 31, 2010 at 9:23 am</a></div><p>The default read more link has a class of more-link which you can use in your CSS.</p><div class="commentnumber">#7433</div></div></li></ul></li><li class="comment odd alt thread-even depth-1" id="li-comment-7435"><div id="comment-7435"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://1.gravatar.com/avatar/752225205a9b6a525ea2fa8e524ece58?s=36&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn">Mark</cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-7435"> January 31, 2010 at 10:03 am</a></div><p>Thank you but how do I get the more link to appear when using this &lt;?php echo excerpt(25)&quot;</p><p>Thanks.</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=7435#respond" onclick="return addComment.moveForm(&quot;comment-7435&quot;, &quot;7435&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#7435</div></div><ul class="children"><li class="comment byuser bypostauthor even depth-2" id="li-comment-7466"><div id="comment-7466"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/0375e723bd400a99acb6f2e08d6ea190?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/" rel="external nofollow" class="url">c.bavota</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-7466"> February 1, 2010 at 11:55 am</a></div><p>Check out the forum:</p><p><a href="https://web.archive.org/web/20100704091800/http://support.bavotasan.com/topic/2-problems-need-solutions-thanks#post-737" rel="nofollow">http://support.bavotasan.com/topic/2-problems-need-solutions-thanks#post-737</a></p><div class="commentnumber">#7466</div></div></li></ul></li><li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-7475"><div id="comment-7475"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://1.gravatar.com/avatar/752225205a9b6a525ea2fa8e524ece58?s=36&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn">Mark</cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-7475"> February 1, 2010 at 4:26 pm</a></div><p>I tried that too but I&#8217;m not understanding what you are asking me to do with that code. As it is different function name and would have no idea how to call it onto my page.</p><p>Thanks.</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=7475#respond" onclick="return addComment.moveForm(&quot;comment-7475&quot;, &quot;7475&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#7475</div></div><ul class="children"><li class="comment byuser bypostauthor even depth-2" id="li-comment-7484"><div id="comment-7484"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/0375e723bd400a99acb6f2e08d6ea190?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/" rel="external nofollow" class="url">c.bavota</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-7484"> February 2, 2010 at 11:36 am</a></div><p>I changed it now so that the function name is the same. It is the exactly same code as above, with the read more link added. So you can add it to your functions.php file exactly how you had originally done it with the code above.</p><div class="commentnumber">#7484</div></div></li></ul></li><li class="comment odd alt thread-even depth-1" id="li-comment-7585"><div id="comment-7585"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/84857d5acbe105d119467c6e35774288?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://www.jasonbobich.com/" rel="external nofollow" class="url">Jason</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-7585"> February 7, 2010 at 6:56 pm</a></div><p>wow thank you so much! I&#8217;m doing a billion things at once.. and I was so glad to come across your post&#8230; just attach the function and I&#8217;m off! thanks again!</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=7585#respond" onclick="return addComment.moveForm(&quot;comment-7585&quot;, &quot;7585&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#7585</div></div></li><li class="comment even thread-odd thread-alt depth-1" id="li-comment-7680"><div id="comment-7680"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/8e32297533377c6cdc6accc1e42fe15c?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://urbanorleans.com/" rel="external nofollow" class="url">Dyce</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-7680"> February 12, 2010 at 8:32 pm</a></div><p>So I guess I&#8217;m the only one getting an &#8220;unexpected T_FUNCTION&#8221; error&#8230;</p><p>I copied the code straight from here. Any ideas on why it&#8217;s not working?</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=7680#respond" onclick="return addComment.moveForm(&quot;comment-7680&quot;, &quot;7680&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#7680</div></div></li><li class="comment odd alt thread-even depth-1" id="li-comment-7681"><div id="comment-7681"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/8e32297533377c6cdc6accc1e42fe15c?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://urbanorleans.com/" rel="external nofollow" class="url">Dyce</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-7681"> February 12, 2010 at 8:59 pm</a></div><p>i give up.</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=7681#respond" onclick="return addComment.moveForm(&quot;comment-7681&quot;, &quot;7681&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#7681</div></div><ul class="children"><li class="comment byuser bypostauthor even depth-2" id="li-comment-7691"><div id="comment-7691"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/0375e723bd400a99acb6f2e08d6ea190?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/" rel="external nofollow" class="url">c.bavota</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-7691"> February 13, 2010 at 9:53 am</a></div><p>What line gives you the error?</p><div class="commentnumber">#7691</div></div></li></ul></li><li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-7741"><div id="comment-7741"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/0ecbab383ba293dda7b0fed654a340bd?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn">gedelis</cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-7741"> February 16, 2010 at 12:48 pm</a></div><p>Thank you very much for the code!!! I was looking for a similar code over the internet for a few hours and then BAM your website! I&#8217;m glad to see that this is very up-to-date code(WP 2.9). <img src="https://web.archive.org/web/20100704091800im_/http://bavotasan.com/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley"/> Works fine on WP 2.9.2 .</p><p>Keep creating good snippets.</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=7741#respond" onclick="return addComment.moveForm(&quot;comment-7741&quot;, &quot;7741&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#7741</div></div></li><li class="comment even thread-even depth-1" id="li-comment-7753"><div id="comment-7753"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://1.gravatar.com/avatar/bc04d8b9080b8e8938890cf56e46ed29?s=36&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn">Louis</cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-7753"> February 17, 2010 at 8:57 am</a></div><p>Hi I dont want the &#8230; to show at all neither any thing ells just the read more what must I do.<br/> Thanx<br/> Louis</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=7753#respond" onclick="return addComment.moveForm(&quot;comment-7753&quot;, &quot;7753&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#7753</div></div><ul class="children"><li class="comment odd alt depth-2" id="li-comment-7754"><div id="comment-7754"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://1.gravatar.com/avatar/bc04d8b9080b8e8938890cf56e46ed29?s=36&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn">Louis</cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-7754"> February 17, 2010 at 9:06 am</a></div><p>never mind I got it to work my way thanx for the great post</p><div class="commentnumber">#7754</div></div></li></ul></li><li class="comment even thread-odd thread-alt depth-1" id="li-comment-7803"><div id="comment-7803"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://1.gravatar.com/avatar/f5e1b16ffe212adc397dc9de8097f61b?s=36&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://guyinism.com/" rel="external nofollow" class="url">DirkJohanson</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-7803"> February 20, 2010 at 3:38 pm</a></div><p>When I get this installed, this will be a fantastic addition to my site, and I thank you for coming up with it.</p><p>One question. The installation instructions state to &#8220;Upload the excerpt-content-word-limit folder to the /wp-content/plugins/ directory.&#8221; I can&#8217;t find any such directory on my computer, including after searching for it in my system as a possible &#8220;file or folder,&#8221; so I&#8217;ve been unable to upload.</p><p>Please let me know if there any place this directory would typically be, or if and how I could create one.</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=7803#respond" onclick="return addComment.moveForm(&quot;comment-7803&quot;, &quot;7803&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#7803</div></div><ul class="children"><li class="comment byuser bypostauthor odd alt depth-2" id="li-comment-7844"><div id="comment-7844"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/0375e723bd400a99acb6f2e08d6ea190?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/" rel="external nofollow" class="url">c.bavota</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-7844"> February 22, 2010 at 1:57 pm</a></div><p>The code above needs to be added to your function.php file which is in your theme&#8217;s directory. If you don&#8217;t have one create one. If you are installing the plugin and you don&#8217;t have a wp-content/plugins folder then you probably don&#8217;t have WordPress installed correctly.</p><div class="commentnumber">#7844</div></div></li></ul></li><li class="comment even thread-even depth-1" id="li-comment-8005"><div id="comment-8005"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/43376e04e7efece6861ebb0d3c95bfb6?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://designprintship.com/" rel="external nofollow" class="url">dave</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-8005"> March 2, 2010 at 4:41 pm</a></div><p>Cheers! Very easy to implement and a huge help for me. The details are what make WordPress such a pleasure to use.</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=8005#respond" onclick="return addComment.moveForm(&quot;comment-8005&quot;, &quot;8005&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#8005</div></div></li><li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-8271"><div id="comment-8271"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://1.gravatar.com/avatar/360c22653969534c02b531c0efdfac4c?s=36&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn">Ozai</cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-8271"> March 15, 2010 at 1:11 am</a></div><p>Bavota,<br/> thanks for the plugin.. however most of the comments here make me feel more frustrated if not DUMB!<br/> has EVERYBODY on Earth become a GEEK??? or is it just the forum?<br/> People here are discussing PHP like the weather! even those who have photos of Old women??? what the hell??</p><p>anyway.. I did install the plugin, and I can&#8217;t seem to go anywhere past that stage:<br/> When you mention in your plugin that:</p><p>&#8212;&#8212;&#8212;-<br/> Instead of the_excerpt() or the_content(), use or within your loop to limit the words for each.</p><p>Example: .</p><p>&#8212;&#8212;&#8212;-</p><p>what do you exactly mean?<br/> where should I place those lines of code? and what&#8217;s the definition of a LOOP? and how do I get to it?<br/> Thanks for your patience..<br/> Peace&#8230;.</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=8271#respond" onclick="return addComment.moveForm(&quot;comment-8271&quot;, &quot;8271&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#8271</div></div><ul class="children"><li class="comment byuser bypostauthor even depth-2" id="li-comment-8280"><div id="comment-8280"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/0375e723bd400a99acb6f2e08d6ea190?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/" rel="external nofollow" class="url">c.bavota</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-8280"> March 15, 2010 at 3:33 pm</a></div><p>The loop is a WordPress function that &#8220;loops&#8221; through your posts and gathers all the information that you want to display. It is the <code>if (have_posts()) : while (have_posts()) : the_post();</code> piece of code you usually see in your theme files. To place something within the loop means to put the code within the segment before the <code>endif;</code> statement.</p><p>For this plugin, you need to replace the default excerpt and content functions with the functions indicated above or it will not work properly.</p><div class="commentnumber">#8280</div></div></li></ul></li><li class="comment odd alt thread-even depth-1" id="li-comment-8281"><div id="comment-8281"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/a21217079f5bc6af52adac4cb0e95c05?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn">Jenn</cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-8281"> March 15, 2010 at 7:33 pm</a></div><p>Thank you SO much for this function! I&#8217;m curious, though, with the content limiter, is it possible to have it remove images from the post&#8217;s content?</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=8281#respond" onclick="return addComment.moveForm(&quot;comment-8281&quot;, &quot;8281&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#8281</div></div><ul class="children"><li class="comment even depth-2" id="li-comment-8282"><div id="comment-8282"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/a21217079f5bc6af52adac4cb0e95c05?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn">Jenn</cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-8282"> March 15, 2010 at 7:42 pm</a></div><p>Nevermind! Just found it in another of your tutorial postings: <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/removing-images-from-a-wordpress-post/" rel="nofollow">http://bavotasan.com/tutorials/removing-images-from-a-wordpress-post/</a></p><p>Thanks a million!</p><div class="commentnumber">#8282</div></div></li></ul></li><li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-9253"><div id="comment-9253"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/e59280745b3f6f86a4cc6fad485647e9?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn">Kathy</cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-9253"> May 4, 2010 at 8:47 pm</a></div><p>Cool little snippet there. Do you know if anyone has a decent snippet for making an excerpt sentence-aware?</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=9253#respond" onclick="return addComment.moveForm(&quot;comment-9253&quot;, &quot;9253&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#9253</div></div></li><li class="comment even thread-even depth-1" id="li-comment-9329"><div id="comment-9329"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://1.gravatar.com/avatar/3a136a2c14b75b220dbaa762f4ab87f6?s=36&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn">gino</cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-9329"> May 10, 2010 at 10:15 am</a></div><p>Hi there</p><p>I have been trying your plugin and it&#8217;s working but it&#8217;s overriding the display only X posts and showing all the available posts.</p><p>Do you know how to stop this?</p><p>thanks</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=9329#respond" onclick="return addComment.moveForm(&quot;comment-9329&quot;, &quot;9329&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#9329</div></div></li><li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-9353"><div id="comment-9353"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://1.gravatar.com/avatar/3a136a2c14b75b220dbaa762f4ab87f6?s=36&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn">gino</cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-9353"> May 11, 2010 at 4:52 am</a></div><p>basically I only want the feed to show part of one post in an HTML site</p><p>your code is great but it ends showing all the posts overriding WP settings to that effect and my ruining my page layout as a result!</p><p>hope this makes sense</p><p>thanks again</p><p>cheers</p><p>g</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=9353#respond" onclick="return addComment.moveForm(&quot;comment-9353&quot;, &quot;9353&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#9353</div></div></li><li class="comment even thread-even depth-1" id="li-comment-9780"><div id="comment-9780"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://1.gravatar.com/avatar/12fda9504e291ba2d725c074a314d8e0?s=36&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://www.vesti5.net/" rel="external nofollow" class="url">Zoran</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-9780"> May 25, 2010 at 4:06 pm</a></div><p>Thanks for the code&#8230; All the best from Serbia&#8230;</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=9780#respond" onclick="return addComment.moveForm(&quot;comment-9780&quot;, &quot;9780&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#9780</div></div></li><li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-10104"><div id="comment-10104"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://1.gravatar.com/avatar/5353cc5513e7ae5744713d3bef3a9a00?s=36&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://www.wpeve.com/" rel="external nofollow" class="url">Mustamar Natsir</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-10104"> June 2, 2010 at 2:56 pm</a></div><p>Great! Thanks for the code. This is awesome and really helpful.</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=10104#respond" onclick="return addComment.moveForm(&quot;comment-10104&quot;, &quot;10104&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#10104</div></div></li><li class="comment even thread-even depth-1" id="li-comment-10868"><div id="comment-10868"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/4b6c1315d17b86465127255fbb053c11?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://weblifelive.com/" rel="external nofollow" class="url">Oleh</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-10868"> June 10, 2010 at 7:57 pm</a></div><p>Hi, I&#8217;ve tried excerpt(); content(); and the_content_limit(); instead of regular the_content(); but I need something different. It&#8217;s so simple, I can&#8217;t believe everyone else would not want this. So I want some $limit of characters/words(whatsoever) including image(s). Many blog posts over globe have image at the beginning.<br/> The content(); does show images, but it also grabs HTML, and in some posts some opening tags being pooled to listing page without closing, and so page get broken. So I need to pool only $limit &#8216;ed text AND images. Ideas?</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=10868#respond" onclick="return addComment.moveForm(&quot;comment-10868&quot;, &quot;10868&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#10868</div></div></li><li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-11858"><div id="comment-11858"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/c6e40f5fdc5378796e17fd8bd2eab820?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn">jack</cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-11858"> June 24, 2010 at 2:45 am</a></div><p>great plugin, tried many similar ones, but this is the only one that has done it correctly.</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=11858#respond" onclick="return addComment.moveForm(&quot;comment-11858&quot;, &quot;11858&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#11858</div></div></li><li class="comment even thread-even depth-1" id="li-comment-11862"><div id="comment-11862"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100704091800im_/http://0.gravatar.com/avatar/4af80d0d43d78b24bb01cf16fd3f9efc?s=36&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&amp;r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100704091800/http://www.kevinscotthailey.com/" rel="external nofollow" class="url">kevin</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/comment-page-1/#comment-11862"> June 24, 2010 at 4:53 am</a></div><p>Very cool plugin!.. Can this work for newest version of wordpress (3.0)</p><p>Thanks.</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/?replytocom=11862#respond" onclick="return addComment.moveForm(&quot;comment-11862&quot;, &quot;11862&quot;, &quot;respond&quot;, &quot;269&quot;)">Reply</a></div><div class="commentnumber">#11862</div></div></li></ol><div class="navigation"><div class="alignleft"></div><div class="alignright"></div></div><div id="respond"><h3>Leave a Reply</h3><div class="cancel-comment-reply"> <a rel="nofollow" id="cancel-comment-reply-link" href="/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/#respond" style="display:none;">Click here to cancel reply.</a></div><form action="https://web.archive.org/web/20100704091800/http://bavotasan.com/wp-comments-post.php" method="post" id="commentform"><p><input type="text" name="author" id="author" value="" size="22" tabindex="1"/> <label for="author"><small>Name (required)</small></label></p><p><input type="text" name="email" id="email" value="" size="22" tabindex="2"/> <label for="email"><small>Mail (will not be published) (required)</small></label></p><p><input type="text" name="url" id="url" value="" size="22" tabindex="3"/> <label for="url"><small>Website</small></label></p><p>To enter code in the comment box, please place it between <strong>&lt;pre lang="php"&gt; &lt;/pre&gt;</strong> tags. You don't have to convert any characters to their hex/HTML code. Just add your code the way you would to any code editor.</p><p><textarea name="comment" id="comment" cols="" rows="10" tabindex="4"></textarea></p><p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment"/> <input type="hidden" name="comment_post_ID" value="269" id="comment_post_ID"/> <input type="hidden" name="comment_parent" id="comment_parent" value="0"/></p></form></div></div></div><div id="sidebar"><div id="search"><form method="get" id="searchform" action="https://web.archive.org/web/20100704091800/http://bavotasan.com/"><div> <input type="text" class="search_input" value="To Search, Type &amp; Hit Enter" name="s" id="s" onfocus="if (this.value == 'To Search, Type &amp; Hit Enter') {this.value = '';}" onblur="if (this.value == '') {this.value = 'To Search, Type &amp; Hit Enter';}"/> <input type="hidden" id="searchsubmit" value="Search"/></div></form><div class="arrow"></div></div><div id="sideads"> <a href="https://web.archive.org/web/20100704091800/http://themes.bavotasan.com/"><img src="https://web.archive.org/web/20100704091800im_/http://bavotasan.com/images/themes.png" alt="Themes by bavotasan.com" class="sideads" style="margin-bottom: 8px;" width="270" height="250"/></a><div id="bsap_1237633" class="bsarocks bsap_8982c17d635c33dbe23a7ef930777c37"></div><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/downloads/delete-duplicate-posts-pro-wordpress-plugin/?xyz=1"><img src="https://web.archive.org/web/20100704091800im_/http://bavotasan.com/wp-content/themes/bavotasan_new/images/ddp-ad.png" class="sideads" alt="Delete Duplicate Posts Pro" width="125" height="125"/></a> <a href="https://web.archive.org/web/20100704091800/https://www.e-junkie.com/ecom/gb.php?cl=88539&amp;c=ib&amp;aff=93121"><img src="https://web.archive.org/web/20100704091800im_/http://bavotasan.com/wp-content/themes/bavotasan_new/images/diggword.png" alt="Digging into WordPress" class="sideads" width="125" height="125"/></a> <a href="https://web.archive.org/web/20100704091800/https://www.e-junkie.com/ecom/gb.php?cl=94455&amp;c=ib&amp;aff=93121" target="ejejcsingle"><img src="https://web.archive.org/web/20100704091800im_/http://bavotasan.com/images/WP-Defender-Cover2.jpg" alt="WordPress Defender" width="125" height="125" class="sideads"/></a> <a href="https://web.archive.org/web/20100704091800/https://secure1.inmotionhosting.com/cgi-bin/gby/clickthru.cgi?id=tinkerpriest&amp;page=7"><img src="https://web.archive.org/web/20100704091800im_/http://creatives.inmotionhosting.com/125x125.v6.gif" class="sideads" width="125" height="125"/></a><div id="bsap_1237624" class="bsarocks bsap_8982c17d635c33dbe23a7ef930777c37"></div><hr style="clear:both;height: 0;border:0;"/></div><div id="popular"><h2>Most Popular Posts</h2><ul class="wppp_list"><li><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/creating-a-jquery-mouseover-fade-effect/" title="Creating a Mouseover Fade Effect with jQuery ">Creating a Mouseover Fade Effect with jQuery </a></li><li><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/a-simple-mouseover-hover-effect-with-jquery/" title="A Simple Mouseover Hover Effect with jQuery">A Simple Mouseover Hover Effect with jQuery</a></li><li><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/downloads/magazine-basic-free-wordpress-theme/" title="Magazine Basic v2.6 WordPress Theme">Magazine Basic v2.6 WordPress Theme</a></li><li><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/downloads/full-sizebackground-image-jquery-plugin/" title="Full Size Background Image jQuery Plugin">Full Size Background Image jQuery Plugin</a></li><li><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/" title="Excerpt or Content Word Limit in WordPress: Redux">Excerpt or Content Word Limit in WordPress: Redux</a></li><li><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/retrieve-the-first-image-from-a-wordpress-post/" title="Retrieve and Display Images from a WordPress Post">Retrieve and Display Images from a WordPress Post</a></li><li><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/processing-multiple-forms-on-one-page-with-php/" title="Processing Multiple Forms on One Page with PHP">Processing Multiple Forms on One Page with PHP</a></li><li><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/downloads/easy-overlay-modal-window-jquery-plugin/" title="Easy Overlay Modal Window jQuery Plugin">Easy Overlay Modal Window jQuery Plugin</a></li><li><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/remove-the-title-attribute-from-wordpress-category-and-page-lists/" title="Remove the Title Attribute from WordPress Category and Page Lists">Remove the Title Attribute from WordPress Category and Page Lists</a></li><li><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/wordpress-3-checking-out-the-new-menu-system/" title="WordPress 3.0: Checking out the New Menu System">WordPress 3.0: Checking out the New Menu System</a></li></ul></div><div id="freewordpress"><h2>Get a Premium Theme for FREE</h2><p><a href="https://web.archive.org/web/20100704091800/https://secure1.inmotionhosting.com/cgi-bin/gby/clickthru.cgi?id=tinkerpriest" class="wordpress-logo"></a><strong>Don't have a Web site?</strong> How would you like to have WordPress and a <a href="https://web.archive.org/web/20100704091800/http://themes.bavotasan.com/category/premium-themes">Themes by bavotasan.com</a> Premium theme installed and configured for <em>FREE</em>? All you need to do is <a href="https://web.archive.org/web/20100704091800/https://secure1.inmotionhosting.com/cgi-bin/gby/clickthru.cgi?id=tinkerpriest">sign up with InMotion Hosting through this link</a>. <br/> <br/> <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/free-premium-theme/">Click here for more information &raquo;</a></p></div><div id="donate"><h2>Support c.bavota</h2><p>If you would like to support <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/">c.bavota</a> and <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/">bavotasan.com</a>, please use the donate link below. Any amount, even $1.00, is appreciated (a man's gotta eat, ya know).</p><form action="https://web.archive.org/web/20100704091800/https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_s-xclick"/> <input type="hidden" name="hosted_button_id" value="5745952"/> <input type="image" src="https://web.archive.org/web/20100704091800im_/https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" name="submit" alt="PayPal - The safer, easier way to pay online!"/> <img alt="" border="0" src="https://web.archive.org/web/20100704091800im_/https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"/></form></div> <a href="https://web.archive.org/web/20100704091800/http://mediatemple.net/" class="mediatemplate"></a></div></div></div><div id="footer"><div id="sitemap"><div id="wrap"><div class="col1"><h2>Stay in tune</h2><div class="tweets"></div> <br class="clear"/><div class="twitter-bird"></div><a href="https://web.archive.org/web/20100704091800/http://twitter.com/bavotasan" class="follow"><em>Follow Me on Twitter!</em></a></div><div class="col2"><h2>Downloads</h2><ul><li><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/downloads/feed-me-seymour-free-wordpress-theme/">Feed Me, Seymour 1.2</a></li><li><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/downloads/magazine-basic-free-wordpress-theme/">Magazine Basic v2.6 WordPress Theme</a></li><li><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/downloads/sliderota-jquery-plugin/">Sliderota jQuery Plugin</a></li><li><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/downloads/full-sizebackground-image-jquery-plugin/">Full Size Background Image jQuery Plugin</a></li><li><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/downloads/easy-overlay-modal-window-jquery-plugin/">Easy Overlay Modal Window jQuery Plugin</a></li><li><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/downloads/snowblind-free-wordpress-theme/">Snowblind v1.1.2 WordPress Theme</a></li><li><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/downloads/8-free-colorful-background-textures-for-designers/">8 Free Colorful Background Textures for Designers</a></li></ul></div><div class="col3"><h2>Tutorials</h2><ul><li><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/scrolling-back-to-top-button-jquery/">Creating a Scrolling Back to Top Button with jQuery</a></li><li><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/get_theme_data-developing-custom-theme-wordpress/">Using get_theme_data() when Developing a Custom Theme for WordPress</a></li><li><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/define-constant-php/">Defining a Constant with PHP</a></li><li><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/wordpress-3-activating-background-editor/">WordPress 3.0: Activating the Background Editor</a></li><li><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/wordpress-3-creating-multi-user-web-sites/">WordPress 3.0: Creating Multi-User Web Sites</a></li><li><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/wordpress-3-checking-out-the-new-menu-system/">WordPress 3.0: Checking out the New Menu System</a></li><li><a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/tutorials/how-to-upload-zip-file-using-php/">How to Upload and Unpack a Zip File using PHP</a></li></ul></div></div></div> <span class="footerleft">Copyright &copy; 2010 <a href="https://web.archive.org/web/20100704091800/http://bavotasan.com/">bavotasan.com</a>. All Rights Reserved. Powered by <a href="https://web.archive.org/web/20100704091800/http://www.wordpress.org/">WordPress</a>.</span><div class="toparrow"></div><span class="backtotop">Back to Top</span></div> <script src="https://web.archive.org/web/20100704091800js_/http://stats.wordpress.com/e-201026.js" type="text/javascript"></script> <script type="text/javascript">st_go({blog:'5317602',v:'ext',post:'269'});var load_cmc=function(){linktracker_init(5317602,269,2);};if(typeof addLoadEvent!='undefined')addLoadEvent(load_cmc);else load_cmc();</script> <script type="text/javascript" src="https://web.archive.org/web/20100704091800js_/http://bavotasan.com/wp-content/themes/bavotasan_new/js/coolstuff.js"></script> <script type="text/javascript">hs.graphicsDir='https://web.archive.org/web/20100704091800/http://bavotasan.com/wp-content/plugins/highslide-integration/highslide/graphics/';hs.outlineType='rounded-white';hs.outlineWhileAnimating=true;</script> <script type="text/javascript">var gaJsHost=(("https:"==document.location.protocol)?"https://web.archive.org/web/20100704091800/https://ssl.":"https://web.archive.org/web/20100704091800/http://www.");document.write(unescape("%3Cscript src='"+gaJsHost+"google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));</script> <script type="text/javascript">try{var pageTracker=_gat._getTracker("UA-452133-5");pageTracker._trackPageview();}catch(err){}</script> </body></html> <!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/ Minified using disk Page Caching using disk (user agent is rejected) Database Caching 33/58 queries in 0.128 seconds using disk Served from: bavotasan.com @ 2010-07-04 09:18:00 --><!-- FILE ARCHIVED ON 09:18:00 Jul 04, 2010 AND RETRIEVED FROM THE INTERNET ARCHIVE ON 21:47:53 Nov 29, 2024. JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). --> <!-- playback timings (ms): captures_list: 0.418 exclusion.robots: 0.018 exclusion.robots.policy: 0.012 esindex: 0.008 cdx.remote: 22.475 LoadShardBlock: 1466.592 (3) PetaboxLoader3.datanode: 180.723 (4) PetaboxLoader3.resolve: 1412.598 (2) load_resource: 158.117 -->

Pages: 1 2 3 4 5 6 7 8 9 10