Online Forum To Support Coders With Technical Assistance - Read Write Execute

Add some text after your wordpress content

Ankit Agrawal
Ankit Agrawal
Published on September 5, 2018 · 1 min read

WordPress comes with many hooks, hooks are functions that can be used to an action or a filter.For adding text after WordPress content we also have a filter.

Add following code into your functions.php file.

function ce_add_text_to_the_content( $content )
{
	$new_content = "Your new content here";
	$content = $content.$new_content;
        return $content;  
}
add_filter( 'the_content', 'ce_add_text_to_the_content' );

WordPress hooks

Was this article helpful?
Ankit Agrawal

Ankit Agrawal

Author & Senior Engineer at CodeExecute

Writing practical engineering guides, debugging real-world bottlenecks, and creating free tools for developer productivity.

← Previous Article How to get user agent in php Next Article → How can we use spacing classes in bootstrap 4