WordPress.org

Ready to get started?Download WordPress

Forums

is $single or the_title depreciated in 1.5? (3 posts)

  1. amory
    Member
    Posted 9 years ago #

    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

  2. Anonymous
    Unregistered
    Posted 9 years ago #

    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.

    Read: http://codex.wordpress.org/Template_Tags/the_title
    And: http://codex.wordpress.org/Template_Tags/wp_title

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

  3. amory
    Member
    Posted 9 years ago #

    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(); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.