En dash not displaying in title tag using conditional tags
-
Hi there
The en dash is displaying as – in my title when I switch the title with conditional tags to get more information. I have tried replacing the – with – but I still get the same problem. I can’t post a link as working locally sorry but here is the example code:
<title><?php
if(is_home()) {
echo bloginfo(‘name’).’ ’ Home’;
} elseif(is_category()) {
echo ‘Browsing the Category ‘;
wp_title(‘ ‘, true, ”);
} elseif(is_archive()){
echo ‘Browsing Archives of’;
wp_title(‘ ‘, true, ”);
} elseif(is_search()) {
echo ‘Search Results for “‘.$s.'”‘;
} elseif(is_404()) {
echo ‘404 – Page got lost!’;
} else {
bloginfo(?nameí); wp_title(‘-‘, true, ”);
}
?></title>and here is what the title looks like:
<title>rockstar – testing, one two three.</title>
Can anyone shed some light on why this is happening? I use MAMP.
Thanks so much in advance – a reply would be much appreciated, have posted around 6 questions in the past 7 or so months and not one post has been answered! I managed to solve or do work arounds for all questions but only after HOURS of research.
- The topic ‘En dash not displaying in title tag using conditional tags’ is closed to new replies.