[Plugin: AJAX Calendar] Category ID doesn't persist through months
-
It seems like this has always been an issue in this plugin (forum thread from 3 years ago), but I’d love to find a fix for it…
The category ID only filters the category on the first month that appears when the page & widget load, after that navigating through months shows all posts.
I’m using this function to add the widget in my theme applying the category ID as the category of the first post on every page:
function custom_ajax_widget() { global $wp_query; $id = $wp_query->post->ID; $cats = get_the_category($id); $catID = $cats[0]->cat_ID; $instance = array( 'title' => '', 'category_id' => $catID ); $args = array( 'before_widget' => '<li class="widget ajax_calendar_widget">', 'after_widget' => '</li>', 'before_title' => '<h3>', 'after_title' => '</h3>' ); the_widget('AJAX_Calendar_Widget',$instance,$args); }
It shouldn’t make a difference to the behaviour of the widget, but might provide more flexibility in the solution to this problem, perhaps.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘[Plugin: AJAX Calendar] Category ID doesn't persist through months’ is closed to new replies.