[wp-hackers] How To Append Content To A Post?

Raj list at expost.org
Tue Sep 7 16:11:07 UTC 2010


Is there anyway of passing the id of the post also?

-----Original Message-----
From: wp-hackers-bounces at lists.automattic.com [mailto:wp-hackers-bounces at lists.automattic.com] On Behalf Of Eric Mann
Sent: Tuesday, September 07, 2010 8:43 PM
To: wp-hackers at lists.automattic.com
Subject: Re: [wp-hackers] How To Append Content To A Post?

All post content passes through the 'the_content' filter.  To append anything to post content merely requires that you hook into that filter and append your content.
 
For example, the following will append a paragraph element with body "this was
appended":
 
function my_append_content($content) {
$content = $content + "<p>This was appended</p>"; return $content; }   add_filter('the_content', 'my_append_content');   On September 7, 2010 at 3:01 PM Raj <list at expost.org> wrote:

> 
>
> What is the proper method to append some content to a post. Suppose I 
> want to append a newsletter subscription form or an advertisement to 
> the end of all posts, what is the best method of doing this?
>
> 
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
wp-hackers at lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list