• Resolved Oken

    (@oken)


    Hello!

    I was wondering if there was anyway to display the last update date for individual categories on a index page.

    Example:

    Blog Category was Last Updated: 6/4/2010

    I have a more visual example of what I’m looking for on the website itself under the navigation bar, only they’re only displaying the dates for the current post loop:

    https://www.angryrabbit.com/blog/

    I’ve searched everywhere for an answer to this, and I’m all out of ideas. I would gratefully appreciate any input or at least point me into the right direction.

Viewing 2 replies - 1 through 2 (of 2 total)
  • <?php
    $cat_id = get_cat_ID('Blog');
    $args=array(
      'cat' => $cat_id,
      'post_type' => 'post',
      'post_status' => 'publish',
      'posts_per_page' => 1,
      'caller_get_posts'=> 1
    );
    $my_query = null;
    $my_query = new WP_Query($args);
    if( $my_query->have_posts() ) {
      while ($my_query->have_posts()) : $my_query->the_post();
      echo 'Blog category last updated ' . get_the_time('F j, Y');
      endwhile;
    }
    wp_reset_query();  // Restore global post data stomped by the_post().
    ?>
    Thread Starter Oken

    (@oken)

    Great! That’s exactly what I was looking for! Thanks so much!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Displaying a Category’s last update’ is closed to new replies.