• Resolved gholemu

    (@gholemu)


    Hi all,

    I want to add current year next to post title. Not talking about permalinks (year/postname/), but strictly about the title of the post, something like Post Tile – 2011.

    I’ve tried this thing already in the title div, doesn’t seem to work: <?php the_time('Y') ?>

    Any other suggestions?

    Thank you!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter gholemu

    (@gholemu)

    Ok, figured that out, it’s working now. But All in One SEO “covers” it in the <title> tag. How can I make it work there aswell?

    This should work:

    <div class="title">
    <h3><?php the_title(); ?> - <?php the_time('Y'); ?></h3>
    </div>

    Do you mean All in One SEO doesn’t display the year in the title tag, only the actual title?

    Thread Starter gholemu

    (@gholemu)

    Thanks for your answer.

    I’ve tried the snippet above, it doesn’t work, not sure why. I managed to have the year shown in the post title (Post title Year), but not in the browser.

    And yes, if I can’t have it shown on WP, without AIOSP, then it would be nice to have it in AIOSP.

    I’m not sure I’m explaining myself clear enough since I’m not a programmer.

    Thread Starter gholemu

    (@gholemu)

    This is the link (google shortened so it’s not indexed by search engines) https://goo.gl/BppYE

    I want the year to appear in the browser title, either in WP/theme directly, either in AIOSP.

    Thread Starter gholemu

    (@gholemu)

    Here’s what I have now:

    <title><?php if (is_home()) : ?><?php bloginfo('name'); ?> - <?php bloginfo('description'); ?>
    <?php else : ?>
    <?php wp_title('', 'false'); ?> - <strong><?php the_time('Y'); ?></strong>
    <?php endif; ?></title>

    The title of the post appears on the browser, but the year doesn’t.

    I’ve emphasised the year part.

    Thread Starter gholemu

    (@gholemu)

    Guess it’s not really possible at this point or there’s too much work for an experiment. The topic needs to be closed.

    Thanks everybody for their support and advices.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How to add current "Year" in post title’ is closed to new replies.