<title>
<?php
if (function_exists('is_tag') && is_tag()) {
single_tag_title("Tag Archive for ""); echo '" - '; }
elseif (is_archive()) {
wp_title(''); echo ' Archive - '; }
elseif (is_search()) {
echo 'Search for "'.wp_specialchars($s).'" - '; }
elseif (!(is_404()) && (is_single()) || (is_page())) {
wp_title(''); echo ' - '; }
elseif (is_404()) {
echo 'Not Found - '; }
if (is_home()) {
bloginfo('name'); echo ' - '; bloginfo('description'); }
else {
bloginfo('name'); }
if ($paged>1) {
echo ' - page '. $paged; }
?>
</title>
Dynamic Title Tag
Chris Coyier
on
if you want the site-title to appear first, this would do:
(replace [html] and [php ?> with <html> <php ?>)
1. Not very clean code, it could be better.
2. isn’t wp_title(); function enough?
Can you please share about how to make dynamic heading tag (h1,h2) for WordPress theme? I usually used free WordPress theme at wordpress.org and It’s hard to find a great free theme. Thanks mate.