Skip to content

Instantly share code, notes, and snippets.

@Asikur22
Last active April 10, 2019 15:29
Show Gist options
  • Save Asikur22/4963fb302ffbfc3b9a0e to your computer and use it in GitHub Desktop.
Save Asikur22/4963fb302ffbfc3b9a0e to your computer and use it in GitHub Desktop.
[WordPress Title Tag]
<title>
<?php
if (function_exists('is_tag') && is_tag()) {
single_tag_title("Tag Archive for &quot;"); echo '&quot; - '; }
elseif (is_archive()) {
wp_title(''); echo ' Archive - '; }
elseif (is_search()) {
echo 'Search for &quot;'.wp_specialchars($s).'&quot; - '; }
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment