Skip to content
Advertisement

Append post thumbnail timage to the first content heading tag

I want to add new conditions to the following code:

JavaScript

I also need to include h3, h4 and h5, example:

JavaScript

How can I do it? The thumbnail should be added only to the first occurrence of a heading tag, regardless of its type (h2, h3, etc.)

Thanks

Advertisement

Answer

You can achieve this my modifying your function to the following:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement