[Plugin: List category posts] Excerpt – keep formatting by editing catlist.php
-
Hi everyone,
I would like to keep HTML markup in Excerpts. I’ve found the code catlists.php which strips any markup but my php isn’t too good and would like to allow <span> and <p> in excerpts. Please advise, code is below from line 228:
public function get_excerpt($single){ if ( $this->params['excerpt']=='yes' && !($this->params['content']=='yes' && $single->post_content) ){ /* * Strip shortcodes - #5 * https://codex.www.ads-software.com/Function_Reference/strip_shortcodes */ if($single->post_excerpt){ return $single->post_excerpt; } $lcp_excerpt = strip_shortcodes(strip_tags($single->post_content)); $exc_lim = intval($this->params['excerpt_size']); $lcp_excerpt = mb_substr($lcp_excerpt, 0, $exc_lim) . '...'; return $lcp_excerpt; } else { return null; } }
https://www.ads-software.com/extend/plugins/list-category-posts/
Viewing 12 replies - 1 through 12 (of 12 total)
Viewing 12 replies - 1 through 12 (of 12 total)
- The topic ‘[Plugin: List category posts] Excerpt – keep formatting by editing catlist.php’ is closed to new replies.