Why not use substr?
Function example that returns shortened excerpt:
function shortened_excerpt() {
echo substr(get_the_excerpt(), 0, 30) . "...";
}
Related Posts:
- Check if the user has explicitly set an excerpt
- How to override function in functions.php of parent theme?
- Show Video in Excerpt
- When is wp_trim_excerpt() called?
- Stripping shortcode from custom excerpt function
- Remove images from get_the_excerpt
- Custom page template how to check is_page from functions.php?
- display public excerpt for private post
- get_the_excerpt() not returning anything when post has no excerpt
- get excerpt without images
- Allow latex in wordpress excerpt
- Custom excerpt legnths for specific pages
- How to filter out shortcode when displaying the_excerpt() in the loop?
- Using “Read More” link with custom excerpt
- How to display post content instead of excerpt
- Using Schema with `the_excerpt`
- Limit length of first excerpt in the loop
- new_excerpt_more link not working properly
- Excerpts are not displayed by a shortcode on category pages
- How to display retweet count and likes in the meta above the excerpt
- Setting a default text for excerpts of a particular category
- Remove links from the_content when using filters wp_trim_excerpt
- Excerpt for pages not showing
- How do I pull excerpts from pages?
- WordPress Excerpt – How to remove the first link using functions.php
- Strip div From Excerpt
- How to change value of variable in theme file with functions.php WordPress?
- first paragraph of the_content as meta description
- Adding Read More to Custom excerpts
- Limit number of characters in different excerpts
- the_excerpt function not showing image
- Appending „read more” to the excerpt conditionally
- Hide disclaimer from summary excerpts
- How to make an If Else on Excerpt Filter
- getExcerpt: Make ellipsis appear only if character limit is reached
- need help with ‘… read more’ excerpt in functions.php
- Excerpt length: get 2 paragraphs
- Check if excerpt is empty at loop-portfolio
- Can’t change excerpt length and more tag
- More link – not text
- How to add an excerpt and read more link to a page?
- Adding a filter to my posts
- Excerpt – First Sentence & Read More
- function to show youtube videos within excerpt – if condition and apply_filters
- How to paginate the get_users function?
- opening links in new tab using – add_filter( ‘the_content’, ‘make_clickable’);
- How to add classes to images based on their categories?
- Compare post levels and user levels wishlist member
- Change ul class=”children” for wp_list_pages?
- Target a certain page within wordpress backend (admin) i.e. Pages > About
- Set default options for inserting media
- Session is not starting
- Hide WYSIWYG editor on certain templates
- Polylang: pll_e() & pll__() on functions.php, doesn’t work
- Disable shortlinks like ?p=1234 to prevent scraping
- WP_Remote_Get Not working
- Debugging with functions.php
- Getting first Image from post
- Inserting a functions output after the content
- Combine two different filter callback functions
- Ordering posts by publish date not working?
- What is the correct way of updating wordpress options
- Skeleton Child Theme Add Icon Bar to Header Flex Grid
- Function that outputs second theme url
- error in getting post id
- register_sidebar_widget is deprecated since version 2.8! Use wp_register_sidebar_widget() instead
- Require file in functions from theme directory using PHP
- Remove Custuomize Sections
- (Woocommerce) Order by price when entering specific category
- Adding an option to a shortcode
- Get urls of images in a gallery?
- Undefined variable error in new function
- How can I show immediate and/or parents in a title?
- Add Login/Logout Menu Item to Primary Nav “My Account” Submenu [Woocommerce] [closed]
- Passing Jquery value to WordPress function
- How to override this theme function in child theme
- Unable to add extra elements to the main navi (wp_nav_menu_items)
- Overwriting TwentyTwelve template file with child theme template, but lower in the hierarchy
- A better way to get stats
- Get URLs for AJAX Filter Checkboxes WordPress
- page shows short code not output
- Scheduled post delete – can’t pass the cron arguments
- Prevent function from triggering on current page
- Assign IDs to headings in ACF using functions.php
- Multiple Notifications SetInterval
- Child Theme not loading multiple stylesheets
- Show number of sold products but be first for less than 2
- Class::$template_dir_path=get_template_directory();
- Post date on Custom field
- Fatal error: Call to undefined function add_action() – an untouched problem
- How to wp_enqueue_script with html?
- Is it possible to change parameters of Parent theme function in the Child theme?
- Error function main() is a non-object to construct my Ajax.php
- Combining wp_current_user() and a variable
- Init hook for header send
- java script error Uncaught SyntaxError: Unexpected token ILLEGAL
- new to javascript – using in instead of functions.php, not loading correctly
- Remove Disqus JavaScript from homepage
- User’s Comments Number: Storing it in a meta field for different uses
- Show one post per author and order by custom field