WordPress.org

Ready to get started?Download WordPress

Forums

WP3 RC3 add read more link to excerpt (1 post)

  1. skuja
    Member
    Posted 4 years ago #

    I am trying to add filter as described in documentation here.

    function new_excerpt_more($post) {
    	return '<a href="'. get_permalink($post->ID) . '">' . 'Read the Rest...' . '</a>';
    }
    add_filter('excerpt_more', 'new_excerpt_more');

    Filter produced invalid link. I dumped argument $post and it is not post object and it doesnt have ID property. It is a string that contains default excerpt ending: "[...]" .
    I dont know is this a bug or invalid example in documentation, but i would like to know how can i replace excerpt ending with a "read more..." link?

Topic Closed

This topic has been closed to new replies.

About this Topic