{"id":4212,"date":"2022-08-21T23:30:00","date_gmt":"2022-08-21T18:00:00","guid":{"rendered":"https:\/\/jassweb.com\/solved\/solved-allow-html-in-excerpt\/"},"modified":"2022-08-21T23:30:00","modified_gmt":"2022-08-21T18:00:00","slug":"solved-allow-html-in-excerpt","status":"publish","type":"post","link":"https:\/\/jassweb.com\/solved\/solved-allow-html-in-excerpt\/","title":{"rendered":"[Solved] Allow HTML in excerpt"},"content":{"rendered":"<p> [ad_1]<br \/>\n<\/p>\n<div id=\"answer-141136\" class=\"answer js-answer accepted-answer js-accepted-answer\" data-answerid=\"141136\" data-parentid=\"141125\" data-score=\"142\" data-position-on-page=\"1\" data-highest-scored=\"1\" data-question-has-accepted-highest-score=\"1\" itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n<div class=\"post-layout\">\n<div class=\"votecell post-layout--left\"><\/div>\n<div class=\"answercell post-layout--right\">\n<div class=\"s-prose js-post-body\" itemprop=\"text\">\n<p><strong>COMPLETE GUIDE TO EXCERPTS<\/strong><\/p>\n<p>I&#8217;ve recently answered a few questions regarding excerpts, so I&#8217;m going to give a detailed explanation covering as much as I can.<\/p>\n<p><strong>PREFACE<\/strong><\/p>\n<p>There seems to be a couple of questions arising from this answer on where the code should go, and the answer is, it is really up to you and how you see fit. There are are a couple of options where you can place the code (if not explicitly stated):<\/p>\n<ul>\n<li>\n<p>In your theme&#8217;s functions.php or any file use as a functions file. Just remember when you do this, if the theme is not your own, all changes will be lost when you upgrade your theme<\/p>\n<\/li>\n<li>\n<p>A better way would be to use the code in a child theme. As above, in the functions.php or functions related file<\/p>\n<\/li>\n<li>\n<p>Use the code in a plugin. This is the prefered way as this makes the code available across all themes. If you switch themes, you don&#8217;t have to worry about rewriting the same code.<\/p>\n<\/li>\n<\/ul>\n<p>I hope this clears things up a bit \ud83d\ude42<\/p>\n<p><strong>HTML TAGS\/FORMATTING<\/strong><\/p>\n<p><a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/codex.wordpress.org\/Function_Reference\/the_excerpt\"><code>the_excerpt()<\/code><\/a> first of all doesn&#8217;t accept any parameters, so nothing can be passed to it. It is a fact that <code>the_excerpt()<\/code> trims the content to 55 words, and all HTML tags are stripped before returning the text. <code>the_excerpt()<\/code> is located in <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/core.trac.wordpress.org\/browser\/tags\/3.8.2\/src\/wp-includes\/post-template.php#L0\">wp-includes\/post-template.php<\/a>. To allow certain or all HTML tags in the excerpt, a new excerpt has to be created.<\/p>\n<p>First of all, the original function needs to be removed first, and then the new function needs to be hooked to <a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/codex.wordpress.org\/Function_Reference\/get_the_excerpt\"><code>get_the_excerpt<\/code><\/a>. Please take note, this new excerpt will still be callable as <code>the_excerpt()<\/code> in template files, no need to change that. <code>get_the_excerpt()<\/code> is located in <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/core.trac.wordpress.org\/browser\/tags\/3.8.2\/src\/wp-includes\/post-template.php#L0\">wp-includes\/post-template.php<\/a>.<\/p>\n<p>The excerpt uses <a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/codex.wordpress.org\/Function_Reference\/wp_trim_excerpt\"><code>wp_trim_excerpt<\/code><\/a> to return the trimmed text, so we need to remove <code>wp_trim_excerpt<\/code> first from the excerpt filter. <code>wp_trim_excerpt()<\/code> is located in <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/core.trac.wordpress.org\/browser\/tags\/3.8.2\/src\/wp-includes\/formatting.php#L0\">wp-includes\/formatting.php<\/a>, line 2355. This is how:<\/p>\n<pre><code>remove_filter('get_the_excerpt', 'wp_trim_excerpt');\n<\/code><\/pre>\n<p>You can now add your new excerpt to <code>get_the_excerpt<\/code><\/p>\n<pre><code>add_filter('get_the_excerpt', 'wpse_custom_wp_trim_excerpt');\n<\/code><\/pre>\n<p>To allow html tags\/formatting, we will need to specify which tags you will need to allow. You can use the following <code>strip_tags<\/code> statement to achieve that<\/p>\n<pre><code>$wpse_excerpt = strip_tags($wpse_excerpt, wpse_allowedtags());\n<\/code><\/pre>\n<p>The second argument <code>wpse_allowedtags()<\/code> is a small function that is used to add the tags <code>the_excerpt()<\/code> will allow. For a complete list of valid HTML 5 tags, go and check it out <a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/www.w3schools.com\/tags\/\">here<\/a>. Here is function, add any html tags to this that you need to allow\/keep<\/p>\n<pre><code>function wpse_allowedtags() {\n\/\/ Add custom tags to this string\n    return '&lt;script&gt;,&lt;style&gt;,&lt;br&gt;,&lt;em&gt;,&lt;i&gt;,&lt;ul&gt;,&lt;ol&gt;,&lt;li&gt;,&lt;a&gt;,&lt;p&gt;,&lt;img&gt;,&lt;video&gt;,&lt;audio&gt;'; \n}\n<\/code><\/pre>\n<p>If you need to allow all HTML tags, that is, no stripping of any tags, the <code>strips_tags()<\/code> function can be omitted\/removed completely.<\/p>\n<p>A point to note however, when html tags are allowed, these tags are counted as words, so your word count for excerpts with tags and without tags will not be the same. To correct that, you will need to remove these tags from the actual word count first so that only words are counted.<\/p>\n<p>I have written an excerpt that will allow all tags, count only words as words, and complete a sentence after the set amount of words (so the text won&#8217;t be trimmed mid-sentence) and add a read more text after the last word.<\/p>\n<p>Here is the complete code<\/p>\n<pre><code>function wpse_allowedtags()\n{\n  \/\/ Add custom tags to this string\n  return '&lt;script&gt;,&lt;style&gt;,&lt;br&gt;,&lt;em&gt;,&lt;i&gt;,&lt;ul&gt;,&lt;ol&gt;,&lt;li&gt;,&lt;a&gt;,&lt;p&gt;,&lt;img&gt;,&lt;video&gt;,&lt;audio&gt;';\n}\n\nif (!function_exists('wpse_custom_wp_trim_excerpt')) :\n\n  function wpse_custom_wp_trim_excerpt($wpse_excerpt)\n  {\n    $raw_excerpt = $wpse_excerpt;\n    if ('' == $wpse_excerpt) {\n\n      $wpse_excerpt = get_the_content('');\n      $wpse_excerpt = strip_shortcodes($wpse_excerpt);\n      $wpse_excerpt = apply_filters('the_content', $wpse_excerpt);\n      $wpse_excerpt = str_replace(']]&gt;', ']]&amp;gt;', $wpse_excerpt);\n      $wpse_excerpt = strip_tags($wpse_excerpt, wpse_allowedtags()); \/*IF you need to allow just certain tags. Delete if all tags are allowed *\/\n\n      \/\/Set the excerpt word count and only break after sentence is complete.\n      $excerpt_word_count = 75;\n      $excerpt_length = apply_filters('excerpt_length', $excerpt_word_count);\n      $tokens = array();\n      $excerptOutput=\"\";\n      $count = 0;\n\n      \/\/ Divide the string into tokens; HTML tags, or words, followed by any whitespace\n      preg_match_all('\/(&lt;[^&gt;]+&gt;|[^&lt;&gt;\\s]+)\\s*\/u', $wpse_excerpt, $tokens);\n\n      foreach ($tokens[0] as $token) {\n\n        if ($count &gt;= $excerpt_length &amp;&amp; preg_match('\/[\\,\\;\\?\\.\\!]\\s*$\/uS', $token)) {\n          \/\/ Limit reached, continue until , ; ? . or ! occur at the end\n          $excerptOutput .= trim($token);\n          break;\n        }\n\n        \/\/ Add words to complete sentence\n        $count++;\n\n        \/\/ Append what's left of the token\n        $excerptOutput .= $token;\n      }\n\n      $wpse_excerpt = trim(force_balance_tags($excerptOutput));\n\n      $excerpt_end = ' &lt;a href=\"' . esc_url(get_permalink()) . '\"&gt;' . '&amp;nbsp;&amp;raquo;&amp;nbsp;' . sprintf(__('Read more about: %s &amp;nbsp;&amp;raquo;', 'wpse'), get_the_title()) . '&lt;\/a&gt;';\n      $excerpt_more = apply_filters('excerpt_more', ' ' . $excerpt_end);\n\n      \/\/$pos = strrpos($wpse_excerpt, '&lt;\/');\n      \/\/if ($pos !== false)\n      \/\/ Inside last HTML tag\n      \/\/$wpse_excerpt = substr_replace($wpse_excerpt, $excerpt_end, $pos, 0); \/* Add read more next to last word *\/\n      \/\/else\n      \/\/ After the content\n      $wpse_excerpt .= $excerpt_more; \/*Add read more in new paragraph *\/\n\n      return $wpse_excerpt;\n\n    }\n    return apply_filters('wpse_custom_wp_trim_excerpt', $wpse_excerpt, $raw_excerpt);\n  }\n\nendif;\n\nremove_filter('get_the_excerpt', 'wp_trim_excerpt');\nadd_filter('get_the_excerpt', 'wpse_custom_wp_trim_excerpt');\n<\/code><\/pre>\n<p>You can just remove the &#8216;\/\/&#8217; from functions that you need extra.<\/p>\n<p><strong>CUSTOM EXCERPT LENGTHS<\/strong><\/p>\n<p>Sometimes you need to display simple excerpts of different lengths and it is not viable to write an excerpt for every post\/function\/page. Here is a nice small little function using <code>wp_trim_words<\/code><\/p>\n<pre><code>function wpse_custom_excerpts($limit) {\n    return wp_trim_words(get_the_excerpt(), $limit, '&lt;a href=\"'. esc_url( get_permalink() ) . '\"&gt;' . '&amp;nbsp;&amp;hellip;' . __( 'Read more &amp;nbsp;&amp;raquo;', 'wpse' ) . '&lt;\/a&gt;');\n}\n<\/code><\/pre>\n<p>What this little function does is taking <code>get_the_excerpt<\/code>, trimming it to <code>$limit<\/code> set by the user, and returning the text with a read more link at the end.<\/p>\n<p>You can call this excerpt as follow in your template<\/p>\n<pre><code>echo wpse_custom_excerpts($limit);\n<\/code><\/pre>\n<p>where <code>$limit<\/code> will be your word count, so an excerpt of 30 words will be<\/p>\n<pre><code>echo wpse_custom_excerpts(30);\n<\/code><\/pre>\n<p>Just one thing to remember here, if you set your limit to more that 55 words, only 55 words will be returned as the excerpt is only 55 words in length. If longer excerpts are needed, use <code>get_the_content<\/code> instead.<\/p>\n<p><strong>CUSTOM EXCERPT LENGTH<\/strong><\/p>\n<p>If you just need to alter the length of <code>the_excerpt()<\/code>, you can use the following function<\/p>\n<pre><code>function wpse_excerpt_length( $length ) {\n    return 20;\n}\nadd_filter( 'excerpt_length', 'wpse_excerpt_length', 999 );\n<\/code><\/pre>\n<p>Remember, you will need to set a priority bigger than 10 so that your custom function executes after the default.<\/p>\n<p><strong>ADD READ MORE LINK<\/strong><\/p>\n<p>All text returned by the excerpt have the hated <code>[...]<\/code> at the end that is not clickable. To add a read more text in the place of the hellips, use this function<\/p>\n<pre><code> function wpse_excerpt_more( $more ) {\n    return ' &lt;a class=\"read-more\" href=\"'. get_permalink( get_the_ID() ) . '\"&gt;' . __('Read More', 'your-text-domain') . '&lt;\/a&gt;';\n}\nadd_filter( 'excerpt_more', 'wpse_excerpt_more' );\n<\/code><\/pre>\n<p><strong>EDIT<\/strong><\/p>\n<p><strong>Excerpt first paragraph<\/strong><\/p>\n<p>I want to keep this complete, so here is the excerpt that trims after the first paragraph.<\/p>\n<p>Here is a function that keeps HTML tags in tact, adds a &#8220;Read More&#8221; link at the end of the excerpt and trims the excerpt after the first paragraph.<\/p>\n<pre><code>if ( ! function_exists( 'wpse0001_custom_wp_trim_excerpt' ) ) : \n    \n    function wpse0001_custom_wp_trim_excerpt($wpse0001_excerpt) {\n        global $post;\n        $raw_excerpt = $wpse0001_excerpt;\n        if ( '' == $wpse0001_excerpt ) {\n    \n            $wpse0001_excerpt = get_the_content('');\n            $wpse0001_excerpt = strip_shortcodes( $wpse0001_excerpt );\n            $wpse0001_excerpt = apply_filters('the_content', $wpse0001_excerpt);\n            $wpse0001_excerpt = substr( $wpse0001_excerpt, 0, strpos( $wpse0001_excerpt, '&lt;\/p&gt;' ) + 4 );\n            $wpse0001_excerpt = str_replace(']]&gt;', ']]&amp;gt;', $wpse0001_excerpt);\n    \n            $excerpt_end = ' &lt;a href=\"'. esc_url( get_permalink() ) . '\"&gt;' . '&amp;nbsp;&amp;raquo;&amp;nbsp;' . sprintf(__( 'Read more about: %s &amp;nbsp;&amp;raquo;', 'pietergoosen' ), get_the_title()) . '&lt;\/a&gt;'; \n            $excerpt_more = apply_filters('excerpt_more', ' ' . $excerpt_end); \n    \n            \/\/$pos = strrpos($wpse0001_excerpt, '&lt;\/');\n            \/\/if ($pos !== false)\n            \/\/ Inside last HTML tag\n            \/\/$wpse0001_excerpt = substr_replace($wpse0001_excerpt, $excerpt_end, $pos, 0);\n            \/\/else\n            \/\/ After the content\n            $wpse0001_excerpt .= $excerpt_more;\n    \n            return $wpse0001_excerpt;\n    \n        }\n        return apply_filters('wpse0001_custom_wp_trim_excerpt', $wpse0001_excerpt, $raw_excerpt);\n    }\n    \nendif; \n    \nremove_filter('get_the_excerpt', 'wp_trim_excerpt');\nadd_filter('get_the_excerpt', 'wpse0001_custom_wp_trim_excerpt');\n<\/code><\/pre>\n<h2>EDIT 29-10-2015<\/h2>\n<p>For anyone that need a workaround to not display the read more link after the excerpt when the excerpt is shorter that the amount of words set, please see the following question and answer<\/p>\n<ul>\n<li>Read more tag shows up on EVERY post<\/li>\n<\/ul>\n<\/div>\n<div class=\"mt24\"><\/div>\n<\/div>\n<p>            <span class=\"d-none\" itemprop=\"commentCount\">23<\/span> <\/p><\/div>\n<\/div>\n<p>[ad_2]<\/p>\n<p>solved Allow HTML in excerpt <\/p>\n","protected":false},"excerpt":{"rendered":"<p>[ad_1] COMPLETE GUIDE TO EXCERPTS I&#8217;ve recently answered a few questions regarding excerpts, so I&#8217;m going to give a detailed explanation covering as much as I can. PREFACE There seems to be a couple of questions arising from this answer on where the code should go, and the answer is, it is really up to &#8230; <a title=\"[Solved] Allow HTML in excerpt\" class=\"read-more\" href=\"https:\/\/jassweb.com\/solved\/solved-allow-html-in-excerpt\/\" aria-label=\"More on [Solved] Allow HTML in excerpt\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[627],"tags":[681,339],"class_list":["post-4212","post","type-post","status-publish","format-standard","hentry","category-wordpress","tag-excerpt","tag-php"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>[Solved] Allow HTML in excerpt - JassWeb<\/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:\/\/jassweb.com\/solved\/solved-allow-html-in-excerpt\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[Solved] Allow HTML in excerpt - JassWeb\" \/>\n<meta property=\"og:description\" content=\"[ad_1] COMPLETE GUIDE TO EXCERPTS I&#8217;ve recently answered a few questions regarding excerpts, so I&#8217;m going to give a detailed explanation covering as much as I can. PREFACE There seems to be a couple of questions arising from this answer on where the code should go, and the answer is, it is really up to ... Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jassweb.com\/solved\/solved-allow-html-in-excerpt\/\" \/>\n<meta property=\"og:site_name\" content=\"JassWeb\" \/>\n<meta property=\"article:published_time\" content=\"2022-08-21T18:00:00+00:00\" \/>\n<meta name=\"author\" content=\"Kirat\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kirat\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-allow-html-in-excerpt\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-allow-html-in-excerpt\/\"},\"author\":{\"name\":\"Kirat\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31\"},\"headline\":\"[Solved] Allow HTML in excerpt\",\"datePublished\":\"2022-08-21T18:00:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-allow-html-in-excerpt\/\"},\"wordCount\":830,\"publisher\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\"},\"keywords\":[\"excerpt\",\"php\"],\"articleSection\":[\"WordPress\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-allow-html-in-excerpt\/\",\"url\":\"https:\/\/jassweb.com\/solved\/solved-allow-html-in-excerpt\/\",\"name\":\"[Solved] Allow HTML in excerpt - JassWeb\",\"isPartOf\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#website\"},\"datePublished\":\"2022-08-21T18:00:00+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-allow-html-in-excerpt\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/jassweb.com\/solved\/solved-allow-html-in-excerpt\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-allow-html-in-excerpt\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/jassweb.com\/solved\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[Solved] Allow HTML in excerpt\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/jassweb.com\/solved\/#website\",\"url\":\"https:\/\/jassweb.com\/solved\/\",\"name\":\"JassWeb\",\"description\":\"Build High-quality Websites\",\"publisher\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/jassweb.com\/solved\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\",\"name\":\"Jass Web\",\"url\":\"https:\/\/jassweb.com\/solved\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png\",\"contentUrl\":\"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png\",\"width\":693,\"height\":132,\"caption\":\"Jass Web\"},\"image\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31\",\"name\":\"Kirat\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750\",\"contentUrl\":\"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750\",\"caption\":\"Kirat\"},\"sameAs\":[\"http:\/\/jassweb.com\"],\"url\":\"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[Solved] Allow HTML in excerpt - JassWeb","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:\/\/jassweb.com\/solved\/solved-allow-html-in-excerpt\/","og_locale":"en_US","og_type":"article","og_title":"[Solved] Allow HTML in excerpt - JassWeb","og_description":"[ad_1] COMPLETE GUIDE TO EXCERPTS I&#8217;ve recently answered a few questions regarding excerpts, so I&#8217;m going to give a detailed explanation covering as much as I can. PREFACE There seems to be a couple of questions arising from this answer on where the code should go, and the answer is, it is really up to ... Read more","og_url":"https:\/\/jassweb.com\/solved\/solved-allow-html-in-excerpt\/","og_site_name":"JassWeb","article_published_time":"2022-08-21T18:00:00+00:00","author":"Kirat","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kirat","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jassweb.com\/solved\/solved-allow-html-in-excerpt\/#article","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/solved-allow-html-in-excerpt\/"},"author":{"name":"Kirat","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31"},"headline":"[Solved] Allow HTML in excerpt","datePublished":"2022-08-21T18:00:00+00:00","mainEntityOfPage":{"@id":"https:\/\/jassweb.com\/solved\/solved-allow-html-in-excerpt\/"},"wordCount":830,"publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"keywords":["excerpt","php"],"articleSection":["WordPress"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/jassweb.com\/solved\/solved-allow-html-in-excerpt\/","url":"https:\/\/jassweb.com\/solved\/solved-allow-html-in-excerpt\/","name":"[Solved] Allow HTML in excerpt - JassWeb","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/#website"},"datePublished":"2022-08-21T18:00:00+00:00","breadcrumb":{"@id":"https:\/\/jassweb.com\/solved\/solved-allow-html-in-excerpt\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jassweb.com\/solved\/solved-allow-html-in-excerpt\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jassweb.com\/solved\/solved-allow-html-in-excerpt\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/jassweb.com\/solved\/"},{"@type":"ListItem","position":2,"name":"[Solved] Allow HTML in excerpt"}]},{"@type":"WebSite","@id":"https:\/\/jassweb.com\/solved\/#website","url":"https:\/\/jassweb.com\/solved\/","name":"JassWeb","description":"Build High-quality Websites","publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jassweb.com\/solved\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/jassweb.com\/solved\/#organization","name":"Jass Web","url":"https:\/\/jassweb.com\/solved\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/","url":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","contentUrl":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","width":693,"height":132,"caption":"Jass Web"},"image":{"@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31","name":"Kirat","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/image\/","url":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750","contentUrl":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750","caption":"Kirat"},"sameAs":["http:\/\/jassweb.com"],"url":"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/"}]}},"_links":{"self":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/4212","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/comments?post=4212"}],"version-history":[{"count":0,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/4212\/revisions"}],"wp:attachment":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/media?parent=4212"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/categories?post=4212"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/tags?post=4212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}