0815

Du musst dich anmelden um Beiträge und Themen zu erstellen. Einloggen · Registrieren

Invite Readers to Comment via Feed

Nice little snippet showing how to invite your readers to leave a comment by clicking on a link within your feed. Just add the following code to your theme’s functions.php file:

// comment invite feed link
function rss_comment_footer($content) {
	if (is_feed()) {
		if (comments_open()) {
			$content .= 'Comments are open! <a href="'.get_permalink().'">Add yours!</a>';
		}
	}
	return $content;
}

In place, this function will output a link that says, “Comments are open! Add yours!” This message will be displayed at the end of each post for which comments are open. If comments are closed, no invite message is displayed.

Source: Hendry Lee




0