How do you get specific tags from the_content?
Using preg_match_all() you can create a regex pattern to find and extract tags (and their content). With WordPress’s post_content hook, you can find and list all the H1’s within current posts content with something like: add_action(‘the_content’, function ($content){ // look for <h1> tags and text therein, anticipate class/id name $findH1s = preg_match_all(‘/<h1 ?.*>(.*)<\/h1>/i’, $content, $h1s); … Read more