excerpt_length filter does not work on manually added filter so you use wp_trim_excerpt function, you can develop code same as following to achieve it.
<?php
if( has_excerpt() ){
the_excerpt();
} else {
wp_trim_excerpt();
}
?>
excerpt_more does not work on WordPress version 2.8.x and Older for those versions you have to use following filter.
<?php
function new_excerpt_more( $excerpt ) {
return str_replace( '[...]', '...', $excerpt );
}
add_filter( 'wp_trim_excerpt', 'new_excerpt_more' );
?>
Related Posts:
- How to filter out shortcode when displaying the_excerpt() in the loop?
- new_excerpt_more link not working properly
- Setting a default text for excerpts of a particular category
- Appending „read more” to the excerpt conditionally
- Hide disclaimer from summary excerpts
- How to make an If Else on Excerpt Filter
- need help with ‘… read more’ excerpt in functions.php
- How to add an excerpt and read more link to a page?
- function to show youtube videos within excerpt – if condition and apply_filters
- Define custom Page Template without its own .php file
- Removing default image size list in Media Box
- How to restrict actions and filters “properly” by conditions
- Check if the user has explicitly set an excerpt
- How to override function in functions.php of parent theme?
- syntax for remove_filter in parent theme with class
- Override parent theme function that is not hooked or in the functions.php file
- Stripping shortcode from custom excerpt function
- Removing title from page
- Hide some items from Screen options in dashboard for products
- Exclude filter on front page
- Allow latex in wordpress excerpt
- Replace Archive Widget Link Text
- Exclude Empty Child Categories in Menu
- Best way to programatically add “rel” attributes to page and post images
- add_filter priority problem
- Clean-up script tags
- Remove function or filter
- Super simple shortcode not working
- Using “Read More” link with custom excerpt
- Adding multiple taxonomy filters to functions.php
- Last updated date function
- How to display post content instead of excerpt
- How to set default archive image without overriding first attached image? [closed]
- Only let plugin add actions to wp_head & wp_footer on single posts
- Using Schema with `the_excerpt`
- How to put “Read more” link in Custom Excerpt inside p tag?
- How to make custom column Admin>Users sortable?
- Get Current Post ID in functions php, meta query filter
- Output and filter data from a XML url
- What did I do wrong in my functions code, that will not change the “Get New Password” text to “Send It”?
- Limit length of first excerpt in the loop
- How to filter $content in shortcode function
- Give “Read More” precedence over excerpt() word count
- Filtering out the #more anchor link that gets produced by
- Excerpts are not displayed by a shortcode on category pages
- Add Element as a Filter to the_content
- How can I add a filter for specific categories on functions.php?
- How to add custom JavaScript in functions?
- How would I go about replacing this function in my child theme located in inc/template-tags.php
- Retrieve a value from Yoast SEO to use to set a default twitter card image honoring overrides
- Can’t properly set the_title add_filter to show short_URL
- Filter an WordPress Function in (general-template.php)
- Remove links from the_content when using filters wp_trim_excerpt
- Excerpt for pages not showing
- Filter nav menu items HTML tags and wrap inner text with span
- WordPress Excerpt – How to remove the first link using functions.php
- How can I add a class to a nav li depending on URL?
- Modify gform_other_choice_value for specific form and specific field in Gravity Forms
- login_headertitle is deprecated since version 5.2.0
- Set “woocommerce_is_purchasable” to false for specific “$product->is_stock_status”
- Filter to wp_list_authors
- How to add custom li item to wordpress menu
- More tag locked in Hemingway
- Add Adsense code between job listings – wp job manager plugin
- Problem with images URL after filter applying
- remove_action not working, even after changing priority [duplicate]
- remove/hide wp-editor
- Add a class to post if it has been recently updated
- search form leads to 404
- Limit number of characters in different excerpts
- how to add_filter to non hook function
- how can I add filter in specfic field in my website?
- How to display an image before title text in menu items
- Overwrite text in a complicated filter hook
- Filter Post Title without affecting screen-reader-text
- Save_post – Warning: Cannot modify header information
- custom error message for empty username and password using authenticate filter not working
- Add #primary at the end of navlink permalinks on single posts
- remove_filter function to unhook twentysixteen parent theme function
- only update titles of single posts
- OOP Switch statement with array as parameter
- How can I automatically delete comments that contain a URL?
- How to add class dynamically from templates
- how can I change the read more link destinations and direct all to the same page?
- ACF Filter return value
- Graphic before title – Specific Category
- $content is empty while using DOMDocument
- Regex works in regexr, but not if I filter content [closed]
- Retrieve a custom form field modified by a filter
- functions.php filters not applied in AJAX call
- getExcerpt: Make ellipsis appear only if character limit is reached
- Excerpt length: get 2 paragraphs
- Settings in functions.php used by a plugin
- Print all inline styles to head
- Force resize for all video content
- Way of getting queried loop before the query with a filter hook?
- Excerpt – First Sentence & Read More
- Trying to get this function to show below the content
- Warning: call_user_func_array() expects parameter 1 to be a valid callback
- How can I modify or filter this variable in an existing class? (Mai Theme)