Excerpts are short texts or summaries

learn more… | top users | synonyms

13
votes
6answers
13k views

Using wp_trim_excerpt to get the_excerpt() outside the loop

I'm building a theme that is going to show excerpts on the homepage for potentially dozens of posts. I don't have manual excerpts on all of my posts, so $post->post_excerpt is empty for many posts. ...
8
votes
7answers
28k views

GET the excerpt by ID

Why is it that one cannot get the excerpt by ID like with the title and most other elements. eg. get_the_excerpt(ID). I know how to use it with the $post->post_excerpt function but that does not ...
8
votes
2answers
458 views

Compare the_excerpt() to the_content()

Is there a way to compare the_excerpt() to the_content() to know if the_excerpt() is actually showing the entire post content? for instance, if a post were particularly short. ultimately i'd like to ...
8
votes
2answers
923 views

How to end the excerpt with a sentence rather than a word?

Here is the excerpt of the post on my home page. I want to end the excerpt with a sentence. In this case it is ' opportunities. '. I know how to modify the length but it won't do what i want. Here ...
4
votes
2answers
387 views

How to get the unfiltered excerpt, without […] or auto-excerpting

The standard way of getting an excerpt is to use the_excerpt() or get_the_excerpt() template tags. I am trying to get just the actual content of the Excerpt field. If there is an excerpt, I want to ...
4
votes
2answers
4k views

Issue with enabling formatting in excerpts in Wordpress

This is what I added in my theme's functions.php file to enable formatting for excerpts in Wordpress (source of the tip): remove_filter('get_the_excerpt', 'wp_trim_excerpt'); ...
4
votes
4answers
13k views

Twenty Eleven home page show only excerpt

I am using the brand new twenty eleven theme, my home page is set to show latest posts, but it displays the entire posts, I want to only show the excerpts, not the entire content, Here is the ...
3
votes
5answers
15k views

Get excerpt using get_the_excerpt outside a loop

I have a code that call get_the_title() and it works, but get_the_excerpt() return empty. How can i make it work? This code is inside a plugin called "WP Facebook Open Graph protocol". Here's the ...
3
votes
3answers
2k views

Adding a rich text editor to Excerpt

I need add to the excerpt field the TinyMCE Advanced editor, any ideas? I have the qTranslate plugin (multilanguage), and it's impossible to connect teh excerpt with this plugin and an editor. ...
3
votes
2answers
569 views

Excerpt Word Count

The code below from WPSnipps provides an excerpt character counter, but I'd like to count words instead. Does anybody have an idea of how to do this? // Excerpt character count function ...
3
votes
5answers
6k views

How to control manual excerpt length?

I have a website in which I need to control the displayed excerpt length. Some of the posts might have manual excerpt so I can't use the excerpt_length filter. I can, of course, use some kind of ...
3
votes
5answers
2k views

Show Video in Excerpt

So I recently figured out how to change my blog page to display excerpts by changing the <?php the_content(); ?> to <?php the_excerpt(); ?> in my index.php file. I am using a custom child ...
3
votes
1answer
555 views

Neither the_excerpt() nor the_content() works properly?

I'm wondering what should be used in index.php (post listing page): the_excerpt() or the_content()? Twenty Thirteen uses the_content() but this prints entire content unless <!--more--> exists ...
3
votes
5answers
2k views

Cannot strip JW Player shortcode?

On the WordPress archive template I am using a custom excerpt function that includes a reference to strip_shortcodes(). For some reason, shortcodes are being rendered and displayed in the archive. ...
3
votes
1answer
86 views

Manual excerpts for pages not working on Search

Image says it all... Page Edit: Search Results: functions.php to enable page excerpts add_post_type_support( 'page', 'excerpt' ); search.php code for displaying excerpt <?php ...
2
votes
4answers
3k views

Modify 'Read more' link adding a new class

I want to add a class to the 'Read more' link. Actually I have this: <?php the_content( 'Read more...' ); ?> Which outputs: <a href="...?p=14#more-14" class="more-link">Read ...
2
votes
3answers
1k views

can the_excerpt function also get images?

Not sure if im going about this in the right way but, overall, ive been told to create, kind of like a news box on my home page and so, the "latest news" is going to be this clients posts. now i know ...
2
votes
1answer
480 views

Allow HTML in excerpt

Here is my excerpt code. // Generate custom excerpt length function wpbx_excerpt_length($length) { return 300; } add_filter('excerpt_length', 'wpbx_excerpt_length'); How do I allow html like ...
2
votes
2answers
1k views

Custom excerpt length on home page

I thought that I got this working but unfortunately it is not. I need my static home page to have an excerpt length of 50 and every other pages to have one of 20. Here is my code so far: function ...
2
votes
2answers
455 views

How do I modify this page template to show subpage excerpts (not post excerpts)?

I have made a page template which shows linked subpages using this bit of code: <?php $mypages = get_pages( array( 'child_of' => $post->ID, 'sort_column' => 'menu_order', 'sort_or ...
2
votes
3answers
2k views

Remove image caption from post excerpt

I am currently using a wordpress plugin called "limit-posts" to better customize my post excerpts. The only issue I have is the excerpt is including the caption text from the image that is within the ...
2
votes
1answer
1k views

can hyperlinks be displayed in excerpts?

By default, it looks like all hyperlinks are stripped out of excerpts. Perhaps this is to prevent link power from diluting. Is there a way to allow hyperlinks to display in excerpt content?
2
votes
1answer
776 views

Making oEmbed work on the excerpt field

How can I make oEmbed work on the excerpt field so I only have to paste the youtube url in there and then be able to echo 'get_the_excerpt()'? I also want to filter oEmbed and change the wmode but I ...
2
votes
2answers
291 views

Can I have two single.php files and have one display just the post and the other display comments for that specific post?

Obviously, I know I can't have two single.php files. The one with the comments would have to have a different name...maybe single-comments.php or something. I am working on a restaurant reviews site ...
2
votes
3answers
670 views

excerpt in characters

I have code in functions.php: function string_limit_words($string, $word_limit) { $words = explode(' ', $string, ($word_limit + 1)); if(count($words) > $word_limit) array_pop($words); ...
2
votes
1answer
1k views

Add visual editor capability to custom excerpt window?

The custom excerpt field (under Add New Post) only accepts html. Thus, you can't just cut and paste a segment from the Visual Editor. If you want links to appear in custom excerpt, you have to know ...
2
votes
2answers
1k views

How to return the_excerpt (without echo)?

Hey all, I see that get_the_excerpt() echoes the post excerpt if it is manually set, but not if it is automatically generated (with just the 55 words, for example). [and its use is deprecated] ...
2
votes
1answer
65 views

make a excerpt on data from a meta box?

I have made a custom post type called news that has meta boxes. I would like to print the data from the metabox as a excerpt. How can I do that? This is the code that I use that prints the data : ...
2
votes
2answers
3k views

limit the words in the post content and add read more link

As you can see into the code, the routine is to display the post which has an id of 266. Now all I want is to limit the words displayed in the post content of that post. Let's say, I want to limit the ...
2
votes
1answer
287 views

Bulk add tag (or any sort of label) to posts who have custom excerpt

The situation is the following: The blog as of now has 2200+ posts. In the beginning (2007/2008) I was using manual excerpts where I would put an image and a little bit of text. The manual excerpt ...
2
votes
2answers
699 views

How to limit 1 image per post on homepage only?

most of my post on wordpress got 6 or 5 images perpost. My problem is if I posted 5 new post with new images, it will be totall 25 images display on my homepage. I want to limit 1 image perpost on ...
2
votes
1answer
667 views

How to link up “read more” on excerpts hack from WP Recipies

I found the code on the WP Recipies page to force excerpts on the home page: function my_excerpts($content = false) { // If is the home page, an archive, or search results if(is_front_page() || ...
2
votes
3answers
1k views

How do I filter the excerpt metabox description in admin?

I want to change the default "Excerpts are optional hand-crafted summaries of your content that can be used in your theme. Learn more about manual excerpts." help text below the Excerpt input area to ...
2
votes
1answer
37 views

Frontend Post Excerpt field mapping

I'm trying to create a form with gravity forms. I need to merge two fields to one Excerpt. I can't give the Excerpt field a merge tag. So I'm trying to use an custom field. My question is now: what ...
2
votes
1answer
80 views

Get the excerpt for a post created by the related author

This has been bugging me for ages and can't quite get it working. I'm using the following code in my functions file to enable me to display posts created by the same author as the current single ...
2
votes
2answers
242 views

Auto Refresh Post List after X seconds

i'm new in wordpress, and i really need a help here. My main site, list the resume (excrept) of all posts, with pagination. But when a user publish a new post, the only way to see it on the main page ...
2
votes
1answer
179 views

First letter cutting off in excerpt

I'm using a plugin to allow for dropcaps for the first letter in my Wordpress theme. However, the excerpt is cutting off the first letter. For example, a sentence like: "This is a Wordpress install" ...
2
votes
1answer
1k views

How to show post(excerpt) from specific category on wp page?

I need this on 3 pages, all 3 from different categories, and then to show several post excerpts from all 3 categories in sidebar of home page.
2
votes
1answer
907 views

Aggregate Summaries of Posts of Different Blogs in Multisite Instance

I have a Multisite Wordpress installation with 7 different blogs. I want to show an aggregate of the summaries of posts from those 7 blogs in the main blog. Do you know a good way to do this?
2
votes
1answer
266 views

Buddypress: Edit activity when new blog post

I am trying to edit the activity on Buddypress (1.7 and running latest Wordpress) for when a new blog post is created. By default it displays the excerpt and shows any attached images, it also strips ...
2
votes
3answers
2k views

How to display only an excerpt of the content with custom post types?

<?php /* Template Name: second */ ?> <?php get_header(); ?> <?php query_posts(array('post_type'=>'event')); ?> <?php if(have_posts()) while(have_posts()) : the_post(); ...
1
vote
2answers
1k views

Excerpts that don't truncate words

I know I can control the length of excerpts using a filter, however it sets the length globally. In my case I have different lengths of excerpts on three different pages. This is what I have now. ...
1
vote
2answers
227 views

How can I create an “excerpt” with text that won't be displayed in the post itself?

I'm currently creating a new theme for my blog and I intend to make it in a magazine style manner. So, to clarify the question in the title: what I want to do is to create a text assigned to the ...
1
vote
2answers
83 views

Why does running get_the_excerpt() when generating JSON file take 28 seconds vs. 599 milliseconds without it?

I am using the following code to generate a JSON feed. I need to extract the excerpt from posts, but when I run get_the_excerpt() it takes 28 seconds (yes SECONDS!) to run on my local server versus ...
1
vote
3answers
3k views

Display Links in Excerpts?

I'm having a problem with the_excerpt and can not find the answer anywhere... I simply want to allow links to be clickable when they are displayed via the_excerpt! There has to be a function for ...
1
vote
2answers
81 views

Show read more link next to last word

I have this excerpt function <?php function pietergoosen_get_the_content_limit_custom_allowedtags() { // Add custom tags to this string return ...
1
vote
2answers
8k views

How can i limit the character length in excerpt? [duplicate]

Possible Duplicate: excerpt in characters I have a question after reading this post (http://wordpress.stackexchange.com/questions/16070/how-to-highlight-search-terms-without-plugin). I like ...
1
vote
2answers
747 views

How to only show the first X words (from each post) on the home page?

How can you have it so that the site's home page will only show the first X (let's say 300) words of the post? But without using "more" tag, or hand filled excerpts? I am looking for a plugin/hack ...
1
vote
2answers
184 views

excerpt_length not working

I'm trying to build a theme, I want to control the length of the post excerpts by doing something like this in functions.php: function theme_excerpt_length( $length ) { return 45; } add_filter( ...
1
vote
1answer
531 views

How can i display the content in plaintext

i want to display my excerpt in plaintext. How can i do this? This is my Snippet where i display the content: <?php the_content(__( 'Weiterlesen &rsaquo;','okay')); ?> How i change the ...