is therer any wordpress function to retrieve a specific html element from post content
You can try extracting the content of the first H1 tag from your post. function get_first_h1(){ //Get filtered content of post ob_start(); the_content(); $content = ob_get_clean(); //Define matching pattern: content of h1 tags $h1_pattern = “~<h1>(.*)</h1>~”; //Variable to hold results $header_matches = array(); //Search content for pattern preg_match( $h1_pattern, $content, $header_matches ); //First match will … Read more