{"id":1132382,"date":"2016-06-27T09:05:22","date_gmt":"2016-06-27T16:05:22","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-excerpt-lenght-ignored-after-update\/"},"modified":"2016-06-27T09:08:15","modified_gmt":"2016-06-27T16:08:15","slug":"custom-excerpt-lenght-ignored-after-update","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-excerpt-lenght-ignored-after-update\/","title":{"rendered":"Custom excerpt length ignored after update"},"content":{"rendered":"<p>Hi there!<\/p>\n<p>About a week ago I updated my functions.php file to create a custom length of my calendar excepts in list view. It contained an if\/else statement that allowed for my blog post excerpts to be a different length than the calendar excerpts. This worked fine until I updated all the calendar plugins (4.2.1)<\/p>\n<p>Right now this is my code that used to work:<\/p>\n<pre><code>\nif ( ! function_exists( &#039;custom_excerpt_length&#039; ) ) {\t\n\tfunction custom_excerpt_length( $length ) {\n\t\t\n\t\tglobal $data;\n\t\t\n\t\tif ( !empty ( $data[&#039;blog_excerpt_limit&#039;] ) ) { \n\t\t\t$excerpt = $data[&#039;blog_excerpt_limit&#039;]; \n\t\t}\n\t\telseif (is_category()) {\n\t\t\t$excerpt = 55;\n\t\t}\n\t\telse {\n\t\t\t$excerpt = 20;\n\t\t}\n\t\treturn $excerpt;\n\t}\n}\n\nif ( ! function_exists( &#039;clear_excerpt_more&#039; ) ) {\t\n\tfunction clear_excerpt_more( $more ) {\n\t\treturn &#039;...&#039;;\n\t}\n}\n\n\tadd_filter(&#039;excerpt_more&#039;, &#039;clear_excerpt_more&#039;);\n\tadd_filter( &#039;excerpt_length&#039;, &#039;custom_excerpt_length&#039;, 999 );\n\nif ( ! function_exists( &#039;zn_limit_content&#039; ) ) {\t\n\tfunction zn_limit_content($string, $word_limit)\n\t{\n\t\t$words = explode(&quot; &quot;,$string);\n\t\treturn implode(&quot; &quot;,array_splice($words,0,$word_limit));\n\t}\n}\n<\/code><\/pre>\n<p>If I just use the code below suggested in other forums posts, it doesn&#8217;t effect any of my excerpts. However, it did before the update:<\/p>\n<pre><code>\nfunction custom_excerpt_length( $length ) {\n    return 20;\n}\nadd_filter( &#039;excerpt_length&#039;, &#039;custom_excerpt_length&#039;, 999 );\n<\/code><\/pre>\n<p>Any thoughts on what might have changed?<\/p>\n<p>Thanks so much!<\/p>\n","protected":false},"template":"","class_list":["post-1132382","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Custom excerpt length ignored after update -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-excerpt-lenght-ignored-after-update\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Custom excerpt length ignored after update -\" \/>\n<meta property=\"og:description\" content=\"Hi there! About a week ago I updated my functions.php file to create a custom length of my calendar excepts in list view. It contained an if\/else statement that allowed for my blog post excerpts to be a different length than the calendar excerpts. This worked fine until I updated all the calendar plugins (4.2.1) [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-excerpt-lenght-ignored-after-update\/\" \/>\n<meta property=\"article:modified_time\" content=\"2016-06-27T16:08:15+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-excerpt-lenght-ignored-after-update\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-excerpt-lenght-ignored-after-update\/\",\"name\":\"Custom excerpt length ignored after update -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2016-06-27T16:05:22+00:00\",\"dateModified\":\"2016-06-27T16:08:15+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-excerpt-lenght-ignored-after-update\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-excerpt-lenght-ignored-after-update\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-excerpt-lenght-ignored-after-update\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Events Calendar PRO\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Custom excerpt length ignored after update\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Custom excerpt length ignored after update -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-excerpt-lenght-ignored-after-update\/","og_locale":"en_US","og_type":"article","og_title":"Custom excerpt length ignored after update -","og_description":"Hi there! About a week ago I updated my functions.php file to create a custom length of my calendar excepts in list view. It contained an if\/else statement that allowed for my blog post excerpts to be a different length than the calendar excerpts. This worked fine until I updated all the calendar plugins (4.2.1) [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-excerpt-lenght-ignored-after-update\/","article_modified_time":"2016-06-27T16:08:15+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-excerpt-lenght-ignored-after-update\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-excerpt-lenght-ignored-after-update\/","name":"Custom excerpt length ignored after update -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2016-06-27T16:05:22+00:00","dateModified":"2016-06-27T16:08:15+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-excerpt-lenght-ignored-after-update\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-excerpt-lenght-ignored-after-update\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-excerpt-lenght-ignored-after-update\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Events Calendar PRO","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/"},{"@type":"ListItem","position":5,"name":"Custom excerpt length ignored after update"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1132382","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1132382\/revisions"}],"predecessor-version":[{"id":1132384,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1132382\/revisions\/1132384"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1132382"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}