You can check to see if the length of the excerpt is longer than the max count.
if(strlen($excerpt) > $count){
$excerpt = substr($excerpt, 0, $count) . '…';
}
…
is the correct ellipsis character to use.
Related Posts:
- get_the_excerpt() not returning anything when post has no excerpt
- Best way of passing PHP variable between partials?
- Custom page with variables in url. Nice url with add_rewrite_rule
- Check if the user has explicitly set an excerpt
- Show Video in Excerpt
- When is wp_trim_excerpt() called?
- How Can I Access a PHP Variable in Another PHP Function
- Stripping shortcode from custom excerpt function
- Remove images from get_the_excerpt
- Custom page template how to check is_page from functions.php?
- Remove tag on my RSS Feed
- display public excerpt for private post
- get excerpt without images
- Automatically add author’s name to post_tag
- Allow latex in wordpress excerpt
- Custom excerpt legnths for specific pages
- Adding a class to tag list in a function
- Is it better to assign functions like get_the_id() to a variable if it’s used multiple times?
- How to filter out shortcode when displaying the_excerpt() in the loop?
- Using “Read More” link with custom excerpt
- Create single.php for specific tag by tag id or name
- list tags with count in author profile page
- Product Tags in Add New product as checkbox list [closed]
- How to display post content instead of excerpt
- Retrieve tags data in post body
- Echo tags used to describe the theme
- Assigning WP functions which echo to PHP variables
- Passing values from a widget to a function within a plugin
- Using Schema with `the_excerpt`
- Frontend tag edit/submit form
- Using $themename Variables
- Is possible add icon in title posts only in specific tag?
- Custom Post excerpt not working correctly
- Limit length of first excerpt in the loop
- new_excerpt_more link not working properly
- Display tags that only appear in one category
- Excerpts are not displayed by a shortcode on category pages
- Add a unique class to HTML tag/element
- How to pass variables from a function in functions.php to an other one
- How to display retweet count and likes in the meta above the excerpt
- Setting a default text for excerpts of a particular category
- How to edit the Tags within the image file URLs?
- Define PHP variable from a seperate API if statement
- Remove links from the_content when using filters wp_trim_excerpt
- Excerpt for pages not showing
- Function filter breaking tag archive menus
- Tags break custom Excerpt function
- problem loading stylesheets to wp_head dynamically
- Numbering lines of code with the tag?
- How do I pull excerpts from pages?
- WordPress Excerpt – How to remove the first link using functions.php
- Randomizing wp_tag_cloud() in child theme
- Undefined variable error in new function
- 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
- Sort and display pages with specific custom field (not tag)
- Adding Read More to Custom excerpts
- Function to echo (or display?) wordpress tags in the head section
- add_menu_page() with variable function
- Do I Need to Prefix Variables Inside Functions?
- the_excerpt function not showing image
- Updating custom query var with multiple values
- Change Page Title
- What is wp_get_post_tags for media tags?
- get variables data from functions.php to template wordpress (without global variables)
- Allow user only create specific tags
- Getting value of variable from functions.php and debugging it
- Pass post ID from archive template to functions file
- How to access custom class methods from any include without using global
- Appending „read more” to the excerpt conditionally
- Removing sanitize_title_with_dashes Function with The Real Title
- method to fetch entire tag list on archive.php
- Hide disclaimer from summary excerpts
- Using a variable in name of dynamically-called helper function
- require_once() Causing categories and tag pages on dashboard to not refrsh
- Change post count on tag/terms pages to 10
- How to make an If Else on Excerpt Filter
- Add array of category IDs to global variable?
- Custom taxonomy not refreshing page on add
- Automatically add tag if a checkbox is checked
- Setting a cookie in functions.php and it gets deleted when working on an other function
- need help with ‘… read more’ excerpt in functions.php
- Excerpt length: get 2 paragraphs
- Check if excerpt is empty at loop-portfolio
- Make WordPress search for only this tags or exclude certain tags from search [duplicate]
- How to get tags and categories?
- Can’t change excerpt length and more tag
- More link – not text
- Using Output from one Function and calling it into another
- How to add an excerpt and read more link to a page?
- Adding a filter to my posts
- How do I access variables outside a function [closed]
- Excerpt – First Sentence & Read More
- If two tags in the middle i need comma
- Trying to get this function to show below the content
- add variable to actions/functions across different files (woocommerce)
- Display function from functions.php in tag.php
- Bulk set Post Title as Tag where Tag is Empty Function
- function to show youtube videos within excerpt – if condition and apply_filters