"Read the Full Article" Link in Feeds
Adds a link back to the post at the end of every feed item, so readers who see a summary in their reader or inbox can click through to your site.
Opens WPIDE on
Code
// Link text.
$wpide_feed_link_text = 'Read the full article on our website';
$wpide_feed_read_more = function ( $content ) use ( $wpide_feed_link_text ) {
return $content . '<p><a href="' . esc_url( get_permalink() ) . '">' . esc_html( $wpide_feed_link_text ) . ' →</a></p>';
};
add_filter( 'the_excerpt_rss', $wpide_feed_read_more, 20 );
add_filter( 'the_content_feed', $wpide_feed_read_more, 20 );
Notes
Change the link text at the top.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.