• Resolved graham333

    (@graham333)


    I’m think I’m nearly there with this but I don’t know how to insert the correct code, hoping someone here can put me straight.

    All I want to do is add the Post title to ‘the-excerpt’ at the bottom of the text, instead of the ‘Read More’ link.

    I have searched the Codex, and found this snippet below which adds a ‘more’ link, when added to functions.php


    // Replaces the excerpt “more” text by a link
    function new_excerpt_more($more) {
    global $post;
    return ‘<a class=”moretag” href=”‘. get_permalink

    ($post->ID) . ‘”>Read More…’;
    }
    add_filter(‘excerpt_more’, ‘new_excerpt_more’);

    This works fine, and links to the right Post, but of course just displays ‘read more’ or some added text.

    So how do I make it fetch the Post title instead?

    Any ideas please?
    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘2012 Theme – Change 'Read More' to Post Title Link In Excerpts’ is closed to new replies.