WordPress.org

Ready to get started?Download WordPress

Forums

Time of Day Plug-in (6 posts)

  1. zim
    Member
    Posted 9 years ago #

    I'm in the process of building a new site using WP. The test site is at http://www.zims.com/blog/

    It's using a slightly modified (mainly to include various plug-ins) version of the default theme.

    I've installed Dunstan's Time of Day plugin (the latest version updated for 1.5 htpp://www.ifelse.co.uk/archives/2005/02/20/new-release-of-time-of-day-plugin/).

    The code of included in my index.php is:

    '<small><?php the_time() ?> on <?php the_date() ?> <!-- by <?php the_author() ?> --></small>'

    If you want to see where I've included this take a look at the source for htpp://www.zims.com/wpindex.txt.

    Anyway the code seems to work fine for the top most post of any given day, however for subsequent posts on the same day it just shows the time without the date.

    Any suggestions?

    Thanks,

    Mark

  2. Avenir
    Member
    Posted 9 years ago #

    You'll need to use <?php the_time(); ?> with a date formatting string instead of <?php the_date(); ?> if you want the date to be displayed for all posts. Otherwise it's only displayed for the first post with that date.

    Look at this for more info on date formatting strings.

  3. zim
    Member
    Posted 9 years ago #

    If I feed '<?php the_time(); ?>' parameters like say:
    '<?php the_time(l dS of F Y); ?>'

    The Time of Day plugin appears to fail and he page won't load.

    mark

  4. Avenir
    Member
    Posted 9 years ago #

    I apologize. I wasn't aware of the new release, so I didn't know that the the plugin was now using WP's the_time() function directly.

    If that's the case, then I don't know what to tell you. When the plugin was using it's own function instead of WP's, my fix would have worked. At least it does on my blog. You might consider switching back to the old version?

  5. reid315
    Member
    Posted 9 years ago #

    i wish to separate the two functions, so i can call the real time on a separate function. how will i go about doing so?

  6. Avenir
    Member
    Posted 9 years ago #

    I stopped using Dunstan's Time of Day because I didn't like how it was integrating directly into the the_time tag. I now use the When plugin, which doesn't do that:
    http://dev.wp-plugins.org/browser/when/

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.