0

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 |

3
  • 1
    It's clearer to put in your question one piece of code which shows how your entire code looks now. – mozboz Jul 13 '20 at 14:16
  • @mozboz updated the description – Rejaur Rahman Jul 13 '20 at 15:16
  • Did you add theme support for the title-tag (in functions.php)? – ralphjsmit Jul 13 '20 at 15:19
0

Fixed the bug, pasting the solution here.

        <?php
            if (is_front_page()) {
                echo 'Home | ';
                bloginfo('name');
            }
            else {
                wp_title(' | ', true, 'right');
                bloginfo('name');
            }
        ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.