An easy solution is to write a function to get the extra title. I use a static variable to keep the database calls to one only. Put this in your functions.php
file.
1 2 3 4 5 6 7 | function get_extra_title($post_id) { static $title = null; if ($title === null) { $title = get_post_meta($post_id, "_theme_extra_title", true) } return $title; } |
Outside header.php
, call the function to get the value:
1 | var_dump(get_extra_title($post->ID)); |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.