0

I have auto wordpress blog. I want to add some ads into content Ex content:

Description content
...

http://filehost1.com/file.part1.rar
http://filehost1.com/file.part2.rar
http://filehost1.com/file.part3.rar

http://filehost2.com/file.part1.rar
http://filehost2.com/file.part2.rar
http://filehost2.com/file.part3.rar

I want to insert ads on top of each filehosts. Look like this:

Description content
...

**Ads 1**
http://filehost1.com/file.part1.rar
http://filehost1.com/file.part2.rar
http://filehost1.com/file.part3.rar

**Ads 2**
http://filehost2.com/file.part1.rar
http://filehost2.com/file.part2.rar
http://filehost2.com/file.part3.rar

Please help. Many thanks

Miss Phuong
  • 289
  • 1
  • 4
  • 15

1 Answers1

1

This will add your advertisement code to the end of the content. You can manipulate $content howwever you wish, whatever you return in the function below will be your content. Put it in functions.php.

add_filter( 'the_content', function($content) {
    return $content . 'Advertisement code';
});
C. E.
  • 10,297
  • 10
  • 53
  • 77