X
X
xcyas2014-05-26 16:24:29
Calendar
xcyas, 2014-05-26 16:24:29

How to make a calendar for a specific category in wordpress?

How can I display a calendar in wordpress so that it only displays the posts of the category you are currently in?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xcyas, 2014-06-03
@xcyas

I'm trying to edit the built-in calendar, and I want to change the database query, that's what I wrote, but something is not right here:

$dayswithposts = $wpdb->get_results("SELECT DISTINCT DAYOFMONTH(wposts.post_date)
FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta, $wpdb->term_relationships wcategory 
WHERE wposts.ID = wpostmeta.post_id 
AND wposts.ID = wcategory.object_id 
AND wcategory.term_taxonomy_id = '82' 
AND wposts.post_date >= '{$thisyear}-{$thismonth}-01 00:00:00'
AND wposts.post_type = 'post' AND wposts.post_status = 'publish'
AND wposts.post_date <= '{$thisyear}-{$thismonth}-{$last_day} 23:59:59'", ARRAY_N);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question