Support » Fixing WordPress » is $single or the_title depreciated in 1.5?

  • I have everything working per my upgrade to 1.5 with exception of my titles. Here is the code I use to determine them. Currently, when you access a single entry, there article name is not within the title any more. Thus my question, is $single or the_title depreciated in 1.5, or am I missing something?

    <?php if ($single) { ?>
    <title>Webpage of Amory &loz; <?php the_title(); ?></title>
    <?php } elseif ($cat) { ?>
    <title>Webpage of Amory &loz; <?php single_cat_title('', display); ?></title>
    <?php } else { ?>
    <title>Webpage of Amory &loz; Blog</title>
    <?php } ?>

    I did google around and found nothing in regards to this specifically
    Thanks for any help

Viewing 2 replies - 1 through 2 (of 2 total)
  • No, and no.

    This is what I use (edit: for individual posts): <div class="storytitle_wrap"<?php /*if ($single) { ?> style="display:none"<?php }*/ ?>><div class="storytitle"><?php if ($page_id || $pagename) { echo ""; } else { the_category(",") ?>: <?php } ?><span class="post-<?php the_ID(); ?>"><em><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a></em></span></div>

    Works fine in WP 1.5.

    Edit: here’s my actual title:
    <title><?php bloginfo("name"); ?><?php wp_title(); ?><?php if (!$p && !$m && !$cat && !$section && !$single || $section) { ?> » <?php bloginfo("description"); } ?><?php if ($section) { ?> - <?php echo ucwords($section); } ?></title>

    Edit #2: I was on a roll today until now. You’re attempting to use “the_title()” not “wp_title()” which I keep spitting out in examples.


    Short story: wp_title() is what you want to use.

    Thanks for the reply. It looks like your code is for the post itself (inside the loop) and i was referencing the <title> html tag. Anyway I forgot about the codex…sorry…after a little searching it looks like what i need is <?php single_post_title(); ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘is $single or the_title depreciated in 1.5?’ is closed to new replies.