Exclude category from foreach loop
I believe you are using the following code from this pastebin link function posts_by_year() { // array to use for results $years = array(); // get posts from WP $posts = get_posts(array( ‘numberposts’ => -1, ‘orderby’ => ‘post_date’, ‘order’ => ‘ASC’, ‘post_type’ => ‘my-custom-post-type’, ‘post_status’ => ‘publish’ )); // loop through posts, populating $years arrays … Read more