How do I save the current page title in a variable?
-
I want to save the current page title in a variable.
I have used the_title(); function but that will echo out the value when I want to rather save the current value of the_title(); function in a new variable.
Something along the lines of
$page_title = the_title();
That code above will still echo out the title when want it to just save the value inside the variable. How can I do that?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How do I save the current page title in a variable?’ is closed to new replies.