• I looked about, but couldn’t find this addressed, so I fixed it in my installation, and thought I should share!

    In my template (worked under 1.2, not as a template), I had a piece of code that took today’s date, looked to see if there were photo albums from that day, and then displayed thumbnails if there were. When I installed WP 1.5, the functionality broke, with only the date being displayed, instead of passed.

    I did some digging, and found that in template-functions-general.php, the function for the_time no longer included an option for echo or not. I added that to the parameters, and added the block of code to handle whether or not display the_time. This seems to look like the code from previous versions, and mirrors how the_date looks.

    Sorry if this is a duplicate issue (wasted bandwidth), but it was a show-stopper for me.

    Anyway, here’s what my block looks like now:


    function the_time ( $d = '', $echo = true ) {
    $the_time = apply_filters('the_time', get_the_time ($d ), $d);
    if ($echo) {
    echo $the_time;
    } else {
    return $the_time;
    }
    {

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter k4sso

    (@k4sso)

    And, of course the final curly-brace should be a “close” not an “open”…. typing too fast!

    Thank you for posting this.

    I was having problems trying to figure what how to get the time assigned to a variable.

    Problem solved.

    There is a new function which is get_the_time.

    Yep, Codex updated (I just stumbled across this change while…coding something). I’ll also be slipping get_the_time() into the template tag listings.

    Thread Starter k4sso

    (@k4sso)

    Glad some folks found use of this!

    I hadn’t seen get_the_time — too much to sift through I suppose, and I wanted to make the code I knew used to work in 1.2 work in 1.5. I’ll check it out and see what that does for me. Thanks for the hint in that direction!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘the_time only displays in WP 1.5’ is closed to new replies.