How to show only manual / custom excerpts?

You can use has_excerpt() for this, which checks whether the post has a manually set excerpt. The sample code below uses this function: <?php if ( has_excerpt() ) : // Only show custom excerpts not autoexcerpts ?> <span class=”entry-subtitle”><?php echo get_the_excerpt(); ?></span> <?php endif; ?>

Show Video in Excerpt

filtering the_excerpt() If you remove_filter( ‘get_the_excerpt’, ‘wp_trim_excerpt’ ) and add your own get_the_excerpt filter you can do this. The default filter (wp_trim_excerpt()) can be found on line 2023 of /wp-includes/formatting.php if you want to just modify that. The extent of what you need to do is just modifying which tags are allowed in strip_tags(). overriding … Read more

add_filter on “the_excerpt” only works when post does not have excerpt

I posted an article about this a while ago: function wp_trim_all_excerpt($text) { // Creates an excerpt if needed; and shortens the manual excerpt as well global $post; $raw_excerpt = $text; if ( ” == $text ) { $text = get_the_content(”); $text = strip_shortcodes( $text ); $text = apply_filters(‘the_content’, $text); $text = str_replace(‘]]>’, ‘]]&gt;’, $text); } … Read more

Limit the_excerpt in the first point (.) of the sentence

First, please make sure you understand the difference between the_excerpt and the_content. You are asking about the_excerpt but I suspect that you might actually mean the_content. That said… You can filter the the_excerpt function with a filter of the same name. add_filter( ‘the_excerpt’, function ($excerpt) { return substr($excerpt,0,strpos($excerpt,’.’)+1); } );

Stop strip_shortcodes() stripping content inside shortcodes

Try the filters in your functions.php: add_filter( ‘the_excerpt’, ‘shortcode_unautop’); add_filter( ‘the_excerpt’, ‘do_shortcode’); Props: @bainternet (Source) Or, use your own filter on get_the_excerpt. Put this in your theme’s functions.php: function custom_excerpt($text=””) { $raw_excerpt = $text; if ( ” == $text ) { $text = get_the_content(”); // $text = strip_shortcodes( $text ); $text = do_shortcode( $text ); … Read more

the_excerpt() or get_the_excerpt with shortcode escape

You can make WordPress execute your shortcode in the excerpt by hooking into get_the_excerpt filter and overwriting the default wp_trim_excerpt function, which is responsible of stripping the shortcode tags from the excerpt as pointed by Chip: add_filter(‘get_the_excerpt’, ‘do_my_shortcode_in_excerpt’); function do_my_shortcode_in_excerpt($excerpt) { return do_shortcode(wp_trim_words(get_the_content(), 55)); } This is applied to both the_excerpt() and get_the_excerpt() outputs. If … Read more

How to get post or page excerpt using post_excerpt

EDIT Seems that I some how misunderstood you. I do think you are missing the point of the post_excerpt. When you create a new post or page (AFAIK for pages as well), you have the opportunity to create a manual excerpt in the excerpt meta box (to make it available, just enable it in screen … Read more

How to return the_excerpt (without echo)?

Sure thing my friend, you see, the function “the_excerpt” (located at “WORDPRESSINSTALLDIR/wp-includes/post-template.php”) is the one that makes the echo: function the_excerpt() { echo apply_filters(‘the_excerpt’, get_the_excerpt()); } so, what you want is to use the same function “apply_filters” without the echo: $myexcerpt = apply_filters(‘the_excerpt’, get_the_excerpt()); …and there you have your excerpt.

Excerpt Word Count

Sorry for reading wrong your question @siouxfan45! here is the right answer: just a little improvement in your code and you can count words! just change these two lines: jQuery(“#excerpt_counter”).val(jQuery(“#excerpt”).val().length); to this: jQuery(“#excerpt_counter”).val(jQuery(“#excerpt”).val().split(/\S\b[\s,\.\’-:;]*/).length – 1); Words with single quote like “don’t”, “it’s”, “I’d”, “won’t”…will count as two! If you want them to count as a … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)