WordPress.org

Ready to get started?Download WordPress

Forums

How to link excert_more (2 posts)

  1. ProbablyBest
    Member
    Posted 1 year ago #

    I am currently using excerpt to display a bit of my content and then displaying a read more after that. However can you get it to link to the actual posts itself?

    Thanks!

  2. sdwoods619
    Member
    Posted 12 months ago #

    [please make sure to mark any posted code - http://codex.wordpress.org/Forum_Welcome#Posting_Code ]

    function new_excerpt_more( $more ) {
    	return ' <a class="read-more" href="'. get_permalink( get_the_ID() ) . '">Read More</a>';
    }
    add_filter( 'excerpt_more', 'new_excerpt_more' );

    This is found under the_excerpt()
    http://codex.wordpress.org/Function_Reference/the_excerpt

    I hope this helps.

Topic Closed

This topic has been closed to new replies.

About this Topic