• Resolved Micah Cooksey

    (@micahcooksey)


    Hi, I’m trying to use the following php for my title:
    <title><?php if (is_front_page()) { echo 'Captain Penguin Web Design — McMinnville, Oregon'; } else { wp_title('',true); } ?> — <?php bloginfo('name'); ?></title>
    But my home page title is “Captain Penguin Web Design – McMinnville, Oregon — Captain Penguin Web Design”, which is way too long and I want to knock off that last “Captain Penguin Web Design”. Here’s the link: https://captainpenguin.com.

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • Are you using the All in One SEO Pack plugin? If so, go to its admin page – that is where you change your home page title.

    Thread Starter Micah Cooksey

    (@micahcooksey)

    Thanks, the issue is that I have a static page set for my home page, so whatever I set for the “home” page is applied to the posts page. But yes, I’m using all in one SEO.

    Hi – There is something you are not quite getting…

    When All in One SEO is installed, it does not matter WHAT you programmatically put in a page title – All in One overrides all HTML/PHP for page titles and inserts its own code.

    All in One is aware of your static home page. The title it inserts on a home page comes from the Home Page fields on the All in One admin page.

    If you want to test that, change the home page title on the All in One admin page to something completely unrelated, save, go to your home page, refresh, and notice what the title is.

    Thread Starter Micah Cooksey

    (@micahcooksey)

    I see, so even if I check the box that says “rewrite titles” and hit apply and then uncheck it then it still overrides it?

    I am not sure of the answer to that question. Experiment – change the title to something else, save, check your homepage, uncheck the box, save, check your homepage. Through this you will learn how it works. If you would pass what you discover on to me I’d appreciate knowing it.

    Do you understand that All in One is not creating a file someplace that contains your title text in a file that it then inserts? It is DYNAMICALLY inserting the titles it generates into the code the webserver sends to the users’ browser – it overwrites any existing HTML or PHP title code. If you understand that, then you will understand why certain behaviors occur, and how to get the output results you want.

    Thus the PHP you have in your page header that started this thread is completely ignored when All in One is installed.

    Thread Starter Micah Cooksey

    (@micahcooksey)

    My experience has been that once you check the box to rewrite the titles, unchecking it doesn’t do anything. I could be wrong, so don’t write a book and quote me on that ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘What is wrong with my dynamic title tag?’ is closed to new replies.