/ Published in: PHP
A simple set of conditions to get dynamic title tags in a wordpress template.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<title><?php bloginfo('name');?> - <?php if(is_home()):?><?php bloginfo('description');?><?php endif;?><?php if(is_category()):?><?php single_cat_title();?><?php endif;?><?php if(is_single()||is_page()):?><?php the_title();?><?php endif;?></title>