• Hi folks,

    I’m trying to use the wp_calendar function as both a calendar for access to archives, but also a calendar for upcoming events in a given “calendar_events” category. I’d prefer to do this using the existing wp calendar rather than a plugin like events_calendar, since I want it to have both archives AND events.

    That said, I’ve run up against a wall. Unfortunately the new term_taxonomy thing has got me completely confused! Sorry to be dense, I’m just not very advanced when it comes to SQL. I’m trying to create a modified version of the get_calendar function to suit my purposes, but it’s built using custom SQL.

    $dayswithposts = $wpdb->get_results("SELECT DISTINCT DAYOFMONTH(post_date)
    		FROM $wpdb->posts WHERE MONTH(post_date) = '$thismonth'
    		AND YEAR(post_date) = '$thisyear'
    		AND post_type = 'post' AND post_status = 'publish'
    		AND post_date <> '" . current_time('mysql') . '\'', ARRAY_N);

    I wish I could make it so that this query allowed all posts prior to today, and only posts from a given category in the future. Can anybody help a brotha’ out? ??

    Thanks
    Adam

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘calendar by category’ is closed to new replies.