Change Excerpt "Continue reading" link to External Link (4 posts)

  1. wieceka
    Posted 3 years ago #

    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?

  2. Michael
    Forum Moderator
    Posted 3 years ago #

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

    can you post the full code of that function?

  3. wieceka
    Posted 3 years ago #

    That was exactly it! Thank you!

    The function was echoing the link instead of returning it.

    Thank you!

  4. jaydokie
    Posted 3 years ago #

    What do you mean by "return the link, not echo it;" I want an excerpt with the external link at http://roundhousetalk.com 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.

Topic Closed

This topic has been closed to new replies.

About this Topic