Category specific calendar in wordpress (get_calendar)
I cannot find a category specific calendar, or any sample code to allow me to get slightly dirty... Anyone know of a category specific calendar so I can call it for example:
get_calendar(true, true, $cat_id);
Otherwise I will have to copy the get_calendar function and make my own get post by category loops sigh
Ended up making my own calendar.
This is a really shaky way of doing it but it works great.
Create a new page in your template directory called “the-calendar.php” place the following code in it: http://pastebin.com/sUSzJMWM
Create a new script file (that has access to jquery). Put the following code in it (MAKE SURE YOU HAVE SET site_url to equal “get_template(‘blog_info’) . ‘/’”): http://pastebin.com/Q16ibAZ0
Now just include this wherever you want the calendar to be (keeping in mind that the above script must be accessible): http://pastebin.com/fyhXrCiW Don’t forget to style your date.php page in your wordpress theme directory!!!
Here is some default styling that looks awful but should get you started: http://pastebin.com/NMauFJWq
The Calendar works by calling (via AJAX) an external PHP file that gathers and echos the HTML code that generates the table. On the success of the AJAX, it just fills the specific div with the returning html.
Please feel free to expand on the code and also ask questions if you can’t get it to work! I hope it saves you some time!