Twenty Eleven uses already a conditional statement in content.php to show the excerpt in search results –
<?php if ( is_search() ) : // Only display Excerpts for Search ?
edit this conditional to include the other templates where you want to show the excerpt;
example:
<?php if ( is_search() || is_home() || is_archive() ) : // Only display Excerpts for Search, Posts Page and Archives ?>
Related Posts:
- Get excerpt using get_the_excerpt outside a loop
- How can i display the content in plaintext
- How to force excerpts / teasers in the loop
- Exclude filter on front page
- the_excerpt(), get_the_excerpt() and the_content() all killing “the Loop”
- Content/Excerpt length control for a specific loop?
- Can I use both a custom excerpt and a trimmed excerpt?
- Combining the_excerpt with the_content
- the_excerpt not showing posts
- Using get_the_excerpt() Before The Loop
- Unable to change the “Read more” text inside the_excerpt
- How to get the excerpt for is_home() outside of the loop isn’t working
- “the_excerpt” in loop just keeps repeating first post?
- Only Show Excerpt After First 3 Posts
- Excerpts not showing on main page
- Excerpt isn’t working or am I missing something?
- to get a little more content after ‘read more’ inside loop
- Limit article to 100 characters. Can’t use the_excerpt…
- Return only content in excerpt field in loop
- Get date of last update outside of loop
- Pagination adding extra posts only on page 2
- If Loop has odd number of posts on last page Custom style for last post in it
- Custom page template
- Get posts that matches specific terms of multiple custom taxonomies
- The Loop in Static Page
- How can I use get_permalink() outside the loop?
- Two loops by pre_get_post on same page
- How to check for specific content in comments in the loop
- Problem the_permalink
- Can’t access login screen, wp-login.php 404’s
- Create static front-page with 3-5 recent posts
- Customize WooCommerce Product Images (Placement and size) [closed]
- get latest 5 posts and a specific post and sort in a specific order
- How to check if a post exist?
- Why cant you place the Loop outside of the index.php?
- Pagination for multiple loops
- Infinite Scroll on a loop?
- On single.php, fetch 2 posts created after and 2 posts created before in relation to the actual post (using menu_order)
- Post classes in the loop are being changed in certain themes
- Exclude page name from loop
- PHP if post is already displayed, then
- How to style first post differently with ‘get_template_part’?
- “Call to a member function have_posts() on array” error on have_posts();
- How to exclude or filter password protected posts when using next_post_link() previous_post_link
- How to append a query string to pagination?
- Get the image src and href data from posts
- Sending mail not working correctly
- WordPress shortcode in content, output in sidebar?
- Using variable in WordPress loop as criteria
- Call wp-blog-header.php header without performing a wp_query
- Display post formats differently on index.php (loop in function)
- Get_template_part() problem with the_content()
- How to output thumbnail twice in a loop
- Frontpage pagination by week
- Integrating WordPress with Your Website
- Multiple instances of Featured Image Thumbnail As A Background On Homepage
- Altering “posts_per_page” for defaut loop
- Why doesn’t ‘continue’ work in page?
- Display more than 10 posts on author.php file
- Accessing the Posts page Content
- Query post & loop problem.
- Exclude current post ID from loop in sidepbar.php
- loop inside a loop : search for posts in the same category
- How do i create a loop that list and divide posts into months?
- Forcing page to top of the list when using get_pages
- How to declare a variable in a loop and make it available in the template file
- How to display fields from the loop in two separate divs
- How to use single.php output in function.php
- Duplicate posts on archive page
- Get a specific size from wp_get_attachment_image_src
- Build a Page which shows the Oldest Post with specific Custom Field Value
- WordPress multiple loops with default pagination
- Loop random posts and display odd and even based on two alternating meta values?
- WordPress + Isotope: how to give different widths to each entry?
- hide woocommerce tab if empty
- How to manually define the primary loop
- Url outside the loop
- How to filter get previous post function by meta value DESC and post date DESC?
- Show other category posts in single.php
- Why does it loop twice?
- Cant pull in featured Image
- Custom Looping of WordPress Posts
- Link Button url count php and wordpress
- Posts are being displayed from old to new, in ascending order
- Loop in taxonomy for terms and post
- Set loop format & have a loop inside other one
- Need a conditional to test if title of parent page matches title of child page
- Query counting excluded category on paged loop
- Using shortcode within shortcode with dynamic variable
- modify default HAVE_POSTS() Loop without inserting new variable (i.e. $loop->HAVE_POSTS)
- Display articles related to a custom field on a page
- Why is my pagination showing up?
- show posts from one category with comments only
- How to implement template file and the loop
- Show only posts from todays date [duplicate]
- I need to update the post query? [closed]
- Multiple loop with pagination in same page
- Why did my most recent article fall behind an older one on my site?
- wp_mail sending only once inside foreach loop
- wp_mail function not working in user query loop