Skip to main content
deleted 3 characters in body
Source Link
Krzysiek Dróżdż
  • 25.5k
  • 9
  • 53
  • 74

Yes, it is possible.

You can use the_content hook and assign your own filter to this hook.

Then you should (that is the part when things get a little bit messy) parse and replace content of that post.

So for example you can do it like so:

function my_the_content_filter($content) {
  $content = str_replace('<h2 ', '<img src=""...><h2 ', $content, 1);
  return $content;
}

add_filter( 'the_content', 'my_the_content_filter' );

Yes, it is possible.

You can use the_content hook and assign your own filter to this hook.

Then you should (that is the part when things get a little bit messy) parse and replace content of that post.

So for example you can do it like so:

function my_the_content_filter($content) {
  $content = str_replace('<h2 ', '<img src=""...><h2 ', $content, 1);
  return $content;
}

add_filter( 'the_content', 'my_the_content_filter' );

Yes, it is possible.

You can use the_content hook and assign your own filter to this hook.

Then you should (that is the part when things get a little bit messy) parse and replace content of that post.

So for example you can do it like so:

function my_the_content_filter($content) {
  $content = str_replace('<h2 ', '<img src=""...><h2 ', $content);
  return $content;
}

add_filter( 'the_content', 'my_the_content_filter' );
Source Link
Krzysiek Dróżdż
  • 25.5k
  • 9
  • 53
  • 74

Yes, it is possible.

You can use the_content hook and assign your own filter to this hook.

Then you should (that is the part when things get a little bit messy) parse and replace content of that post.

So for example you can do it like so:

function my_the_content_filter($content) {
  $content = str_replace('<h2 ', '<img src=""...><h2 ', $content, 1);
  return $content;
}

add_filter( 'the_content', 'my_the_content_filter' );