I can think of a number of ways to go about doing this. I'm looking for the most efficient way. Menu looks like this:
catArchive1 [num_new_posts] catArchive2 [num_new_posts] catArchive3 [num_new_posts]
^^[num_new_posts] being the number of new posts
Assuming we have a cookie value set for the users last visit
I could do something like the follow for EACH menu/category
$args = array( 'category' => $cat_id, 'posts_per_page' => -1, 'date_query' => array( 'after' => $_COOKIE['lastvisit'] ), ); $new_posts = get_posts($args); $num_posts = count($num_posts); // Number of new posts
Of course, this is another query for each menu item. Any ideas how to combine this into one and still know how many new posts in each category?