How to insert auto content after post on WordPress

If you want to show a default content like ‘If you like this then please share it!’ on bottom of every post then below code will be really useful. This short snippet will allow you to auto insert content at the end of a post. Open your functions.php and add below code to it.

 
<?php 
	function end_post($content) {
	if(!is_feed() && !is_home()) {
	$content.= "<h2>Enjoy this?</h2>";
	$content.= "<p>Tweet about this post: etc...</p>";
	}
	return $content;
	}
	add_filter ('the_content', 'end_post');
?>

Related posts:

HTML5 page structure

HTML5 offers more powerful structure comparing to older versions of Html. There are many new …


Partner with Us

We are providing an exclusive partnership offer to individuals and companies who are interested in setting up their own web design & development company. For more information about how to partner with us, please contact us