WordPress.org

Forums

wp 'dynamic' title (5 posts)

  1. lucraft
    Member
    Posted 2 years ago #

    I am having an issue with the below:

    <title><?php if (is_single() || is_page()) { wp_title('',true); } else { bloginfo('description'); } ?> — <?php bloginfo('name');?></title>

    It works perfectly for Pages and Posts, however the home page only shows:
    — <?php bloginfo('name');?>

    Instead of the intended:
    <?php bloginfo('description'); ?> — <?php bloginfo('name'); ?>

    Any ideas???

  2. alchymyth
    Forum Moderator
    Posted 2 years ago #

    please post a link to your site.

    what is your text in dashboard - settings - general - tagline?

  3. lucraft
    Member
    Posted 2 years ago #

    The link to the draft site is here.

    The tagline text says: "Specialising in the care of People with Dementia in Teignmouth, Devon"

  4. alchymyth
    Forum Moderator
    Posted 2 years ago #

    possibly because you have a static front page;

    try:

    <title><?php if (is_single() || is_page()) { wp_title('',true); } elseif(is_front_page()) { bloginfo('description'); } else { bloginfo('description'); } ?> — <?php bloginfo('name');?></title>
  5. lucraft
    Member
    Posted 2 years ago #

    Thanks for your reply.

    That doesn't seem to work either, I had also tried something similar:

    <title><?php if (is_single() || is_page()) { wp_title('',true); } elseif (is_front_page()) { bloginfo('description'); } ?> — <?php bloginfo('name');?></title>

    I know it must be simple - so it's driving me insane!

Topic Closed

This topic has been closed to new replies.

About this Topic