Passing content of wp_title to a variable
-
Since I’m integrating blog into existing site and want to use it’s header and footer, what I’m doing is including my own header into header.php and I need somehow to be able to pass (at least) some title to my own header.
I guess best would be to somehow get the content of wp_title but it acts like echo and just outputs it’s content to a page. Is there a solution to stuff it somehow into a variable?
What I came up with so far is this
<?php if(is_home()) { $name=get_settings('blogname'); } else if(is_single()) { global $post; $name= $post->post_title; } ?>
but I would like to get it to work for archive pages and so on…
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Passing content of wp_title to a variable’ is closed to new replies.