Support » Plugins and Hacks » Hacks » Get last date when any item in a custom taxonomy was updated

  • Resolved Morgan Kay

    (@gwendydd)


    I’m creating a theme with custom taxonomies, and I would like for the taxonomy page to show the last date any item in that taxonomy was updated.

    So I have a taxonomy called “genre”, and one of the genres is “Comics.” When a user views the archive for comics, I would like the top of the page to say “Last updated on ___” and show the last date when any post in the “Comics” genre was updated.

    I get the feeling list_categories() is going to help me out here…. How should I do this?

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • the_date($post->ID) should work as long as it is out of the loop. when a category page is called the post data is there for the most recent post (if i remember right)

    Hmm, that doesn’t do anything at all. Perhaps it works differently in a custom taxonomy?

    i may not have put the correct parameters in it, look at the function reference for the_date or get_date and it should give you the info you need

    Ah, I fell victim to a classic blunder. 🙂 the_date doesn’t display if more than one post has been updated on a given day. the_time seems to be working.

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Get last date when any item in a custom taxonomy was updated’ is closed to new replies.