Forums

[resolved] Problems showing the_time() (5 posts)

  1. jonpbradley
    Member
    Posted 2 years ago #

    I'm trying to display the date next to title of my post and I have the following line bit of PHP.

    <?php the_time('F jS, Y'); ?>

    This is returning '12 March 2009' which isn't right! It should be returning March 12, 2009. I've tried various combinations and nothing I do seems to change the output. What I really want is to show the month on one line and the day (numberical) on another with a nice background image (like so many WordPress themes).

    I've done this before on other themes and it's worked fine. Does anyone know if there's either an issue with 2.7 (all the other themes I've done have been older versions of WordPress) or whether there could be something wrong elsewhere (maybe in another file in my theme or in my WordPress installation)? Or am I just being thick!?

    Any help would be appreciated.

    Jon

  2. MichaelH
    Volunteer
    Posted 2 years ago #

    <?php the_time('F jS, Y'); ?>

    would return "March 12th, 2009"

    Are you sure you are putting that code in the correct Template?

    Resources:
    Stepping Into Templates
    Template Hierarchy

  3. jonpbradley
    Member
    Posted 2 years ago #

    I have the same issues even when I'm using the 'Default' theme to which I've made no amendments. Doesn't that suggest it's an issue outside of the 'themes' and templates?

  4. MichaelH
    Volunteer
    Posted 2 years ago #

    If you are using the WordPress Default theme, then that would suggest a plugin causing the problem.

    If you continue this thread, a link to see the problem, would be appreciated.

  5. jonpbradley
    Member
    Posted 2 years ago #

    Thank you!

    Current link is http://www.cricciethfamilychurch.org.uk/site

    They want a bi-lingual site so I'm using the 'Language Switcher' plug-in. I deactivated this and the date function seems to work fine.

    I just hadn't thought about a plug-in issue so thank you for that.

Topic Closed

This topic has been closed to new replies.

About this Topic