Hide “continue reading” from wordpress

There are many articles out there that give you instructions on how to remove or alter the “continue reading” link that is inserted after the excerpt of a post in WordPress. Most of them go about this task using the extremist method which is removing the function from your theme. Why not use a little css to hide it instead…

I came across this problem when I was creating a new site with a “recent news” section on the home page. I use a popular plugin to achieve this task called Category Posts Widget. It allows me to insert a widget in one of the footer widget areas (of the Twenty Ten theme) that calls only posts from a specific category. One of the options that this plugin gives you, is the ability to pull the excerpt from the post and put it under the title. The title is already linked to the post so there really is no need to have another link after the excerpt.

I really don’t want to mess with the function that puts the “continue reading” after the_excerpt() is called because there are other pages and features of wordpress that use the “continue reading” for easy navigation. After finding the location of the function:
/wp-content/themes/twentyten/functions.php
and the code:

function twentyten_continue_reading_link() { return ' <a href="'. get_permalink() . '">' . __( 'Continue reading <span>&rarr;</span>', 'LtcProviderUniversity' ) . '</a>';}

I decided to just add a class to the anchor tag so that is reads:

function twentyten_continue_reading_link() { return ' <a class="continue_reading_link" href="'. get_permalink() . '">' . __( 'Continue reading <span>&rarr;</span>', 'LtcProviderUniversity' ) . '</a>';}

This way I can access the entire link using the class=”continue_reading_link” and put this in my style sheet:

#footer .continue_reading_link {
display:none
}

The best part about this fix is that it stays within your theme folder, therefore it doesn’t break when you update wordpress or a plugin that uses the_excerpt().

Talk about us!