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.

  • 2
    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 Aug 10 '11 at 13:24

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.;


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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