X

Dynamic post title for WordPress site

You can create titles dynamically by adding following code to your header.php file WordPress theme.

 
<title>
	<?php
	  if (is_home()) { echo bloginfo('name');
		  } else if (is_404()) {
					   echo '404 Not Found';
		  } else if (is_category()) {
					   echo 'Category:'; wp_title('');
		  } else if (is_search()) {
					   echo 'Search Results';
		  } else if ( is_day() || is_month() || is_year() ) {
					   echo 'Archives:'; wp_title('');
		  } 
	else {
			echo wp_title('');
		  }
	?>
</title>