WordPress.org

Forums

The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

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

  1. skuja
    Member
    Posted 6 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