I am wanting to insert some code after each post in WordPress... I know you can do it after this for example, in single.php
Here is an example of a filter on the content and the function:
function the_content_replacer($content)
{
//global $post, $posts;
//$content = str_replace(']]>', ']]>', $content);
$content .= "\n<div style=\"display:none;\">text here</div>";
//$content = preg_replace('/="http:\/\/cnn/i',
// '="http://example.com?http://cnn', $content, -1);
return $content;
}
add_filter('the_content', 'the_content_replacer', 1);
--> it is better to post all WordPress questions in http://wordpress.stackexchange.com !!!
--> if you use e.g.
$content .= "\n<div style=\"display:none;\">text here</div>";
it will not remove a closing paragraph tag (note the linebreak at the beginning of the string)