Support » Plugins » Change Excerpt "Continue reading" link to External Link

  • Having some trouble here:

    Trying to have the “Continue Reading” link out to an external site. Got it to work for the title and images of the post using a new function, but having an issue with the excerpt “continue reading” link.

     * Returns a "Continue Reading" link for excerpts
    function twentyeleven_continue_reading_link() {
    	return ' <a href="'. get_homestay_link() . '">' . __( 'View this property <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) . '</a>';

    That’s my new code in functions.php.

    But instead of changing the link, it inserts that link at the top of the excerpt and then the link directs to the homepage. Wierd. Any suggestions?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Michael


    Forum Moderator

    the function get_homestay_link() would need to return the link, not echo it;

    can you post the full code of that function?

    That was exactly it! Thank you!

    The function was echoing the link instead of returning it.

    Thank you!

    What do you mean by “return the link, not echo it;” I want an excerpt with the external link at which presently comes up “Read full story here” underneath the second post titled “Treasury and the IRS Release Tribal General Welfare Guidance”. You can click the title and it takes you to the external post, but clicking on the “Read full story here” links you to a permalink post on my site which then requires that the reader click on the “via” link to get to the external post. It sounds like you all corrected it in this forum post but I am not sure how you did it.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Change Excerpt "Continue reading" link to External Link’ is closed to new replies.