Alright, I solved it:
I queried the year and month of the page we’re on with:
$year = get_query_var('year');
$monthnum = get_query_var('monthnum');
And then I added date parameters to each WP_Query:
$col1 = new WP_Query(
array(
'year' => $year,
'monthnum' => $monthnum,
'posts_per_page' => 1,
'cat' => 31
)
);
This allows me to split the departments of the ‘Magazine’ archive page into different areas, rather than have them mixed in one loop.
Related Posts:
- Category archive by year with permalink support /category/YYYY
- Filtering categories in the permalink structure
- Force WordPress to Show Pages Instead of Category
- Multiple post categories – single permalink
- Categories’ hierarchy in URL
- Changing the category permalink structure
- Exclude subcategories from the url
- How to display only the parent category in the permalink
- Root level category, tag, author and archive pages to work
- Plural Category Base Slug On Category Archive Page
- How to set up Author archives with sub category URL
- WordPress subcategories return 404 in custom template
- force category base – archive pages work WITH & WITHOUT category base slug in url?
- Add “page-a” slug to category link if user visit category link from “page-a”
- One Specific Category To Permalink
- Category being displayed without base parmalink
- How to change category and year archive permalinks/rewrite rules?
- Read GET parameters in APACHE Mod Rewrite rules for WordPress categories in Posts
- Permalinks: display just one kind of wp category in the posts url
- Multiple URL’s based on category for one post
- Remove subcategory and category with some rules from permalink
- WordPress URL Rewrite for dynamic and customized URL
- Category URL Management
- Redirect Problems with Archive Page and GET variables
- Using custom structure prefix showing 404 for sub-categories
- A different permalink structure for different categories
- How to set the same base url for two different taxonomies?
- Remove “category” from permalink with add_rewrite_rule
- WordPress Category url redirects to subdomain
- hierarchical taxonomy in permalinks? using same slug
- Category archive page has two URLs even when default theme is active with no active plugins
- Remove “?category=” in the URL wordpress ajax filter work for category
- How to get category and archive title?
- Custom permalink structure leads to be 404 on pagination
- get_categories for custom post type with a specific custom taxonomy attached
- How To Modify The Loop in archives.php To Have 11 Posts Per Page and CSS Styling
- What’s the URL for a category archive?
- how to use a different domain/subdomain for authors/catagories on single site?
- Sort posts by tags in category pages
- Create permalink structure for one taxonomy archive per custom post type
- How to get the url to tag & category base set by the user?
- How to Include the Parent and Child Category in the Permalink if the Post is Added to Both
- Rewrite url / permalink for default archive – yearly / monthly
- Archive pagination causing 404 with permalinks structure
- WooCommerce change category url and product base
- Remove Archive Headline and Archive Intro Text fields on category and tag archive pages in WordPress Admin with Genesis framework
- Display only posts from referred category on date archive page
- Creating archive pages for children categories
- WordPress categories being called “archives” in google links. How to remove?
- Allow dot in wordpress permalinks (only for categories)
- conditional for sub category on archive page
- How to remove category titles?
- Changing permalink from /postname/ to category/postname/
- How can I define a custom archive for childs of a specific category?
- add_rewrite_endpoint returns 404 on archives
- Multiple category archive page
- Sub Categories Keep Redirecting to Pages With Same Slugs
- Custom category URL rewriting
- Disable date based archives for all categories except one
- Customize category page for different custom taxonomies
- Remove the parent name from permalink
- Redirect single article permalink to paginated category page
- WordPress alphabetical A-Z custom post type post result display
- Hierarchical permalink structure for posts showing categories and sub-categories
- How to Remove a Title from All Category and Tags Page?
- Do not show sub categories in the loop on archive-product.php
- Cannon see subcategory in permalink
- why get_the_post_thumbnail( the_ID()) echos extra post id
- display category list year wise in wordpress
- WordPress monthly archive category specific
- Archive filtering
- Show Secondary Sidebar on Category pages (archive)
- Rebuilding a Site: How to Show Several Category Posts in Woo Framework Theme?
- Add multiple orderby with pre get posts
- Pagination breaks on child-categories, works fine on parent-category
- Add custom categories and subcategories and posts as custom pages
- Get multiple category names from permalink
- Get category base permalink
- Include a page’s “category” in its URL
- How to add a ‘News’ section to specific posts in WordPress
- How to add excerpt and read more button to category archive page
- Remove base category gives 404 error
- Custom permalink /%category%/%postname%/ produces 404 on each post
- Post url rewriting for posts with certain category
- custom browse by
- How to get get_categories()’s ‘hide_empty’ argument to work with global year var in the archive template?
- get_the_terms_list output last child only
- How to get related category/categories in WordPress archive page
- /blog/ permalink prefix causes category pages to 404
- How to count the number of monthly archive?
- Conditional statements based on custom meta value in category archives
- Modify / Rewrite single template url structure
- Most efficient use of custom taxonomies, categories, and pages
- Removing short versions of category archive URL
- Change next_post and previous_link to navigate throught parent categories only
- What approach should I take for this URL structure?
- how wordpress generates permalinks as /%category%/%post%/
- Multiple Parent Category URLs
- Use same wordpress category base and tags as the prefix as the post permalink
- WordPress how to remove parent slug from category URLs