{"id":7680,"date":"2011-03-28T05:02:00","date_gmt":"2011-03-28T09:02:00","guid":{"rendered":"http:\/\/info.template-help.com\/?p=7680"},"modified":"2017-02-22T04:48:01","modified_gmt":"2017-02-22T09:48:01","slug":"how-to-limit-excerpt-length","status":"publish","type":"post","link":"https:\/\/www.templatemonster.com\/help\/how-to-limit-excerpt-length.html","title":{"rendered":"How to limit excerpt length"},"content":{"rendered":"<p>\r\n<p>This tutorial will show you how to limit the post excerpt in WordPress<\/p>\r\n<p>&nbsp;<\/p>\r\n<p><strong>Example 1. Editing loop.php file<\/strong><\/p>\r\n<p>1. Open <strong>wp-content\/themes\/theme###<\/strong> folder<\/p>\r\n<p>2. Open <strong>loop.php<\/strong> file with your HTML\/PHP editor (Dreamweaver, Expression Web etc)<\/p>\r\n<p>3. Use search tool (<strong>CTRL+F<\/strong>) and search for <strong>get_the_excerpt()<\/strong><\/p>\r\n<p>You should see somehting like this:<\/p>\r\n<pre>\r\n&lt;?php if (is_single()) { \r\n\t} else { \r\n\t\t$excerpt = get_the_excerpt(); echo my_string_limit_words($excerpt,'20');\r\n\t}\r\n?&gt;\r\n<\/pre>\r\n<p>Here the excerpts are limited by the number of words. Modify the value here: <span class=\"brush:php\">($excerpt,&#8217;<strong>20<\/strong>&#8216;)<\/span><\/p>\r\n<p>&nbsp;<\/p>\r\n<p>Feel free to check the detailed video tutorial below:<br \/>\r\n<a href=\"\/help\/files\/wordpress\/how-to-limit-excerpt-1.htm\" target=\"blank\">How to limit excerpt length<br \/>\r\n<\/a><\/p>\r\n<\/p>\r\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>This tutorial will show you How to limit excerpt length in WordPress<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[247,728],"tags":[2564,788,871,872,592,2405],"_links":{"self":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/7680"}],"collection":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/comments?post=7680"}],"version-history":[{"count":0,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/7680\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media?parent=7680"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/categories?post=7680"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/tags?post=7680"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}