Untitled UI logotext
Solutions
WebsitesEcommerceMobile AppsWeb AppsProduction Support & Maintenance
Our work
Company
About usBlogPodcastContact us
Book a free consultation

Replace "Excerpt More" function.

Olivia Rhye

So one function in WordPress that operates very well is "the_excerpt". If you like the way it applies it's own character limit but don't like what it adds at the end, this is the post for you! Lets change the excerpt more function!

So lets change the standard [...] of excerpt more and make it a link to the blog post.

First open your functions.php file and add this function

function new_excerpt_more( $more ) {
return '<a href="'. get_permalink(get_the_ID()) .'">[....]</a>';
}

This function will allow you to add the same [...] from the original excerpt more function with a different content. You can put anything you like in that return.

Now lets call the function

add_filter('excerpt_more', 'new_excerpt_more');

This calls and executes your new function.

Have fun!

Ready to start a project?

Book a free consultation
Untitled UI logotext
Our work
About us
Blog
Careers
Submit a ticket
Agency Partnerships
Contact
© 2024 fjorge. All rights reserved.
Privacy