Currently in header I have the following:
<title>
<?php wp_title(' | ', true, 'right'); ?>
<?php bloginfo('name'); ?>
</title>
I tried adding if statement like the following below that did not work it displayed as the following: Roots Restaurant Roots Restaurant
<?php if(is_front_page()) {bloginfo('name');}?>
It should display as Home | Roots Restaurant
on Home page the title tag looks like the following - Roots Restaurant. So it is missing Home |
Currently in header I have the following:
<title>
<?php wp_title(' | ', true, 'right'); ?>
<?php bloginfo('name'); ?>
</title>
I tried adding if statement like the following below that did not work it displayed as the following: Roots Restaurant Roots Restaurant
<?php if(is_front_page()) {bloginfo('name');}?>
It should display as Home | Roots Restaurant
on Home page the title tag looks like the following - Roots Restaurant. So it is missing Home |
Share Improve this question edited Jul 13, 2020 at 15:16 Rejaur Rahman asked Jul 13, 2020 at 13:25 Rejaur RahmanRejaur Rahman 51 silver badge3 bronze badges 3- 1 It's clearer to put in your question one piece of code which shows how your entire code looks now. – mozboz Commented Jul 13, 2020 at 14:16
- @mozboz updated the description – Rejaur Rahman Commented Jul 13, 2020 at 15:16
- Did you add theme support for the title-tag (in functions.php)? – ralphjsmit Commented Jul 13, 2020 at 15:19
1 Answer
Reset to default 0Fixed the bug, pasting the solution here.
<?php
if (is_front_page()) {
echo 'Home | ';
bloginfo('name');
}
else {
wp_title(' | ', true, 'right');
bloginfo('name');
}
?>