Folding Category List (FoCaL)
post count incorrect due to date stamp (1 post)

  1. w_barnes
    Posted 4 years ago #

    Folding Category List displays correct post counts for only a few of my categories and the others show up as 0 regardless of the actual post count. I examined the file focal_wp28.php and found the problem is related to the following SQL that selects a the posts for a given category:

    $querystr = "
      			SELECT DISTINCT $wpdb->posts.ID
      			FROM $wpdb->term_taxonomy, $wpdb->posts, $wpdb->term_relationships
      			WHERE $wpdb->posts.ID = $wpdb->term_relationships.object_id
      			AND $wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id
      			AND $wpdb->term_taxonomy.term_id = $cat->term_id
      			AND $wpdb->posts.post_status = 'publish'
      			AND $wpdb->posts.post_type = 'post'
      			AND $wpdb->posts.post_date < NOW()

    If I remove the last bit that checks the time stamp (posts.post_date) then everything works fine. I checked the time stamps on my posts and the ones not being included have time stamps for today.

    My best guess is that the time stamp in the database has a different time zone than what's returned by NOW().

    Is this an issue with my WordPress database or is there a different way to check the time stamp?



Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Folding Category List (FoCaL)
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic