How can I add/append content to the_content on the home page via a plugin?

As a proof of concept, I’d like to create a simple plugin that loads some content, say “hello world” just after the_content on the home page only. How can I do this from a plugin?

Related posts

Leave a Reply

1 comment

  1. You mean a filter and a check for is_home()?

    add_filter( 'the_content', 'wpse6034_the_content' );
    function wpse6034_the_content( $content )
    {
        if ( is_home() ) {
            $content .= '<p>Hello World!</p>';
        }
        return $content;
    }