You can write your three_dots
function like this:
function three_dots($excerpt) {
// Append the dots to the existing excerpt.
$excerpt .= ' [...]';
return $excerpt;
}
add_filter('the_excerpt', 'three_dots');
About your ‘read more’ button, this usually isn’t handled by the excerpt itself but is instead added after the excerpt in your theme’s template files. If you’ve got a custom ‘read more‘ button, you’d typically place it in your theme’s template file where you’re displaying the excerpt. You can just mod
For instance, in one of your template file, you might have something like:
echo get_the_excerpt();
// Here comes your custom 'read more' button
echo '<a href="' . get_permalink() . '" class="read-more-button">Read More</a>';
Related Posts:
- How to use the_excerpt in a filter hook?
- WordPress hooks/filters insert before content or after title
- How do filters and hooks really work in PHP
- Trouble understanding apply_filters()
- Filter hook before create order WooCommerce
- wp_mail – Remove sitename from email subject
- apply_filters() slices away needed arguments
- WP Rest API – Upload media without saving attachment post
- How to add attribute to output with wp_video_shortcode add_filter
- Anyway to edit the titlebar of WordPress Widgets in the Admin area?
- How to limit the pages displayed for choosing parent page on page attribute’s menu?
- Please explain me what the do_action does
- End excerpt at the end of the sentence
- Is it possible to Hook/Filters Attachment Creation?
- How can I reliably and globally disable wptexturize?
- Customise Jetpack Publicize text
- WordPress RSS feed – filter RSS content by custom field value
- How to hook some Unicode texts into calendar widget safely?
- How to add attributes to tag when template cannot be directly modified
- filter the_title problem in nav
- How can I add a fifth option to the alignment picker?
- Filter the URL of next_posts_link & previous_posts_link
- How to replace any occurence of Gravatars with a local placeholder image?
- How does WordPress call functions attached to a certain action hook before calling functions attached to other hooks
- Sensei LMS Hooks to Remove Content
- Customize user account activation message
- Conditionally call add_action depending on post_type?
- WordPress tag cloud add more links
- Error when overriding only some audio shortcode HTML output
- Gutenberg disable the “block” tab in right sidebar
- When to use actions and when to use filters
- add_filter to ‘woocommerce_before_main_content’ [closed]
- Yoast SEO hooks overriding themselves
- Editing
- Is possible dequeue/remove style from wp_footer() hook and add on wp_head() hook?
- How to call a function or method that is Namespaced using another plugin
- Question about how do wordpress filters/actions work
- How to center oEmbedded content
- Change username before login
- How to change the order (priority) of registered filters (or actions) (e.g. for the_content)?
- How do I target a single page to modify the comment form of only that page?
- How to change the order of HTML output of a core block?
- Why in archive page doesn´t show read more button with excerpt?
- How to removes all instances of thumbnails displayed in my theme?
- How do I add a checkmark to my-sites save settings hook
- How to know what filter to use and how to use it?
- How to filter backend post list showing only posts having a shortcode
- Add Lightbox To WordPress Native Gallery
- Give “Read More” precedence over excerpt() word count
- What hooks to hook onto for automatic cache clearing
- Modify Redux Framework Options in Child Theme
- How to customize category_description()?
- How can I output all apply_filters and do_action?
- How do I override the_excerpt so that it will display full content?
- Set default value for “Additional CSS class(es)” for specific block types
- Disadvantage of using filters & hooks multiple times
- Excerpt is being added above the content, but it should be after it
- How do I hook my function to run only after submitting login form
- run shortcode in excerpt of single custom post type
- Admin post list – adding an option to the date filter dropdown
- Trimming a custom field to a length
- How to add a filter to the get_body_class function?
- Prepending character(s) to a custom tag title?
- Modify existing plugin function with add_filter
- Hook for changing excerpt content when excerpt not set
- How to override include_once pointed file using add_filter?
- Get The Caller (Plugin / Theme / Core) For All actions & Hook in WordPress
- comment_for() Custom fields not visible when user is logged in
- What is the action hook to use if you want to capture the new password during password change?
- Adding html banner to posts
- Is this hook really deprecated? ( manage_{$taxonomy}_custom_column )
- an action hook when a post reaches a certain number of views
- Need to return shortcode text instead of the output
- BuddyPress – A hook available to hide custom born date on public profile view?
- Replace Data In Post & Update Meta Field Post Is Saved
- The gettext hook doesnt work on text with links
- How to add custom media library mime icons?
- Add an attribute to the root from functions.php with add_filter
- Would like to use hook or filters to customize email templates
- Hook to add content after date in post?
- Create different flavours of excerpt
- Is it possible to assign a css id to a row in plugins list table?
- Add Index to Item in WordPress Gallery
- Remove image of srcset
- Add HTML to the bottom of each post in a post list
- Incrementing content with extra text after save/publish
- Read More in the actual excerpt
- wp_editor customization
- is_page_template() doesn’t work with excerpt_length filter
- the_excerpt() does not work with has_excerpt()?
- Custom excerpt_more filter not working when tag is present
- Filter dashboard custom post listing by user
- WooCommerce comments_template Filter Not Firing
- Admin New Order: Autofocus on Search a product
- NextGEN Gallery: Adding drop-down menu widget to gallery view without modifying plugin code [closed]
- How to filter part of a variable if it is no array?
- str_replace css meta tag?
- How do you disable the verification process of user email changes?
- Can you call a filter hook by “add_action”?
- How to Dynamically Switch WordPress Front Page Without Causing Canonical Redirect?