{"id":3381,"date":"2013-08-29T22:12:32","date_gmt":"2013-08-29T22:12:32","guid":{"rendered":"http:\/\/www.dognmonkey.com\/techs\/?p=3381"},"modified":"2020-02-05T10:13:28","modified_gmt":"2020-02-05T18:13:28","slug":"add-excerpts-to-wordpress-themes","status":"publish","type":"post","link":"https:\/\/www.dognmonkey.com\/techs\/add-excerpts-to-wordpress-themes.html","title":{"rendered":"Add Excerpts To WordPress Themes"},"content":{"rendered":"<p style=\"text-align: center;\"><em>There are 2 WordPress themes that I like to use, Twenty Ten and Twenty Thirteen for WP 3.6. The Excerpts is only applied to search by default. If we want excerpts to all main page, categories, and archives, we have to add some conditions in &#8220;content.php&#8221; for Twenty Thirteen and &#8220;loop.php&#8221; for Twenty Ten.<\/em><\/p>\n<p style=\"text-align: center;\"><em>Twenty Ten Theme &#8220;loop.php&#8221;<\/em><\/p>\n<div class=\"igallery\">\n<p style=\"text-align: center;\"><a class=\"preview\" title=\"Loop 2010 modification\" href=\"\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2013\/08\/excerpts2010.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-3382\" src=\"\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2013\/08\/excerpts2010-300x54.jpg\" alt=\"Loop 2010 modification\" width=\"300\" height=\"54\" srcset=\"https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2013\/08\/excerpts2010-300x54.jpg 300w, https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2013\/08\/excerpts2010-1024x186.jpg 1024w, https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2013\/08\/excerpts2010.jpg 1195w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><code>&lt;?php if ( is_archive() || is_search()||is_home()||is_author()||is_tag() ) : \/\/ Only display excerpts for archives and search. ?&gt; &lt;div class=\"entry-summary\"&gt;<\/code><\/p>\n<p><code>&lt;?php the_excerpt(); ?&gt;<\/code><br \/>\n<code>&lt;\/div&gt;&lt;!-- .entry-summary --&gt;<\/code><\/p>\n<p style=\"text-align: center;\"><em>Twenty Thirteen Theme &#8220;content.php&#8221;<\/em><\/p>\n<p style=\"text-align: center;\"><a class=\"preview\" title=\"content.php 2013 mods\" href=\"\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2013\/08\/excerpts2013.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-3383\" src=\"\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2013\/08\/excerpts2013-300x66.jpg\" alt=\"content.php 2013 mods\" width=\"300\" height=\"66\" srcset=\"https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2013\/08\/excerpts2013-300x66.jpg 300w, https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2013\/08\/excerpts2013-1024x228.jpg 1024w, https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2013\/08\/excerpts2013.jpg 1028w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<\/div>\n<p><code>&lt;?php if ( is_search()||is_author()||is_tag()||is_archive()||is_home() ) : \/\/ Only display Excerpts for Search ?&gt; &lt;div class=\"entry-summary\"&gt;<\/code><br \/>\n<code>&lt;?php the_excerpt(); ?&gt;<\/code><\/p>\n<p><code>&lt;\/div&gt;&lt;!-- .entry-summary --&gt;<\/code><\/p>\n<ul class=\"lcp_catlist\" id=\"lcp_instance_0\"><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>There are 2 WordPress themes that I like to use, Twenty Ten and Twenty Thirteen for WP 3.6. The Excerpts is only applied to search by default. If we want excerpts to all main page, categories, and archives, we have to add some conditions in &#8220;content.php&#8221; for Twenty Thirteen and &#8220;loop.php&#8221; for Twenty Ten. Twenty <a href=\"https:\/\/www.dognmonkey.com\/techs\/add-excerpts-to-wordpress-themes.html\" class=\"more-link\">&#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":7547,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,20],"tags":[217,374,375],"class_list":["post-3381","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tips-and-tricks","category-wordpress","tag-excerpts","tag-twenty-ten","tag-twenty-thirteen"],"views":179,"_links":{"self":[{"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/posts\/3381","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/comments?post=3381"}],"version-history":[{"count":4,"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/posts\/3381\/revisions"}],"predecessor-version":[{"id":7546,"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/posts\/3381\/revisions\/7546"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/media\/7547"}],"wp:attachment":[{"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/media?parent=3381"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/categories?post=3381"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/tags?post=3381"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}