SHARE
TWEET

Untitled

a guest Oct 15th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function custom_wp_title() {
  2.   $id = get_queried_object_id();
  3.     $content = get_post($id);
  4.   $html = $content->post_content;
  5.   $doc = new DOMDocument();
  6.   $doc->loadHTML($html);
  7.  
  8.   return $doc->getElementById('my_title')->nodeValue;// you can change ID here //
  9. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top