WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to build a wp plugin, which will basically add some text for every post, in the post itself, I'm afraid that the codex is too large for me to even know what to look for, so I'd appreciate if someone could point me in the right direction.

Edit: As per request, the info should be added to the post's text on the database, at the end of the post, it's not static, it's a random embed from a tube site, based on a query I run on the tubesite.

share|improve this question
Just a bit more guidance. Is it going to be the same text every time? If so it can be a simple template edit. Will the text be different? Will it go at the beginning, end, in the middle of the post? Does that vary? Do you want the text stored in the DB with the post, or just displayed to your reader? If you maybe update your question to be nice and specific, folks can offer some specific guidance for you – Rev. Voodoo Aug 10 '11 at 13:24
up vote 1 down vote accepted

Your best bet is to use the the_content filter hook and add your content to the post "on the fly" for ex:


function add_my_extra_content($content){
   $my_extra = "<h5>this is the extra content</h5>';

   //add before post content
   // return $my_extra.$content;

   //add after post content
   return $content.$my_extra.;

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.