WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Get last date when any item in a custom taxonomy was updated (5 posts)

  1. Morgan Kay
    Member
    Posted 3 years ago #

    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!

  2. security_man
    Member
    Posted 3 years ago #

    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)

  3. Morgan Kay
    Member
    Posted 3 years ago #

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

  4. security_man
    Member
    Posted 3 years ago #

    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

  5. Morgan Kay
    Member
    Posted 3 years ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Topic