You can use PHP’s date
functionality:
// set (or retrieve) the number of menus
$num_menus = 2;
// calculate the current/next menu according to the current/next week (number)
$current_menu = date('W') % $num_menus;
$next_menu = (date('W') + 1) % $num_menus;
All you have to do then, is to map the numbers to the according menus (i.e., custom post types).
Related Posts:
- How to get current get_post_types name?
- How to rewrite URI of custom post type?
- Get term slug of current post
- Set posts of a custom post type to be private by default?
- register_post_type sort order by title by default
- Custom post types – Use post_id in permalink structure
- Permalink rewrite 404 conflict- WordPress Taxonomies/ CPT
- Ordering posts having multiple post-meta date fields
- wp_insert_term doesn’t work with custom post type’s taxonomy
- Populate Taxonomy from Custom Posts
- Order users by number of posts
- Get multiple custom type posts at once in edit.php?post_type request
- Disable revisions for a specific post type only?
- How to get the parent’s taxonomy?
- How do I redirect all 404 errors of a specific post type to another URL?
- Priority of Meta Box for Custom Post Type
- Using previous_post_link and next_post_link to wrap around post sequence
- Same base slug for CPT post and CPT taxonomy terms
- how to make custom posts sticky? [duplicate]
- Replacing the title in admin list table
- Get URL for specific post type and current tag
- How to set custom post type as post title to avoid ‘Auto Draft’
- template_redirect not working, apparently for no reason
- How to validate custom fields for a custom post type before insert?
- Custom Post Type slug same as page name causing a conflict
- Adding paged query to custom URL rewrite
- Structure for projects and clients
- Formatting custom meta box date from YYYY/MM/DD to a more readable alternative
- Optimised Code for Pulling Taxonomy Posts
- Prevent authors from creating new posts of specific custom-post-type
- Why is my custom loop not filtering correctly nor paginating?
- How to create A-Z index listing for custom post types?
- Custom post type search with slug in URL
- Add post_type to index.php
- Creating select dropdown with parent-level custom post types
- CPT Group by Date metabox Value
- How to add a custom taxonomy to show up in a custom post type menu?
- Query Custom posts of same taxonomy as the post itself
- Showing posts from different categories and from custom post type
- Editing a list of several fields
- Custom post type: check permissions and validate nonce
- Custom date changer post_date => future – missed schedule error
- Selecting a post in Dashboard
- Can one create multiple Custom Post Types with a for loop?
- CPT Validation to not show “Post updated.”
- Translating custom post type metaboxes [closed]
- Taxonomy/Custom post type structure suggestion on a movie site
- Get Tags by specific Category of Custom Post Type
- How to sort the admin area of a WordPress custom post type by a custom field
- Custom Field values not Showing in Edit Page of Custom Post Type
- How to make WP_Query not to show irrelevant posts?
- Display custom post types in wp_list_pages
- How to list tags from custom post type attachments?
- Two column layout with alphabetical ordering
- Can anyone clarify difference between archive-{posttype}.php, type-{posttype} and date.php?
- Custom post type index (maybe using get_template_part)
- Custom post type menu
- widget_posts_args not using the number of posts in widget
- gutenberg message
- How to sort a WP_Query by a custom field AND ALSO filter by a different custom field
- Return number of all custom posts type by author in all statuses
- Get current user id
- Print all the tags from a custom post type
- How to organize custom post type list by year?
- How can deregister scripts for a certain custom post type?
- Custom posts – tag pagination
- Getting custom post types to properly display alphabetically
- does wp_insert_term link the term to a certain post ID?
- Ideas to connect external database table to wordpress posts as custom field source
- CPT structure questions
- Custom post type category permalinks and archive pages
- All in one calendar custom post type query doesnt work as expected
- Submit Custom Postypes from frontend
- Navigate by Tags inside a custom Post Type
- add_filter get array data before display in custom post_type
- How to display posts from a certain category in a bootstrap 5 carousel loop with multiple items?
- WordPress Custom Post Loop
- programmatically generated custom post type is created more than once
- Query custom post type and custom field by URL parameters
- How to show posts of the same category on a page?
- Button link display in shortcodes using custom field in ACF
- Peepso: Add extra data field (custom post meta) to postbox
- Can I manage current & past editions of an annual event with a single WordPress install?
- How to hide sub fields in a field group and also the entire field group if the answer selected is “no”
- Taxonomy to Post Type. Every Taxonomy Item can be Producer or Developer
- WordPress Front-End user restricted taxonomies
- Querying, storing, and using data from 2 separate custom post types
- do action inside a class is not working
- How to display data with pagaination on backend?
- Edit post meta direct from post.php?
- Custom Post ‘Post Per Page’ Crashing Page?
- Create an additional template page for every term taxonomy
- Custom Post Type Not Displaying Correctly
- Query Distinct Taxonomies of Custom Post Type
- Excerpt for each post type and for is_front_page
- Change the text on the Publish button
- Loop through multiple custom taxonomy terms and display posts for a custom post type
- strange conditional tag behaviour [duplicate]
- Post object GUID adding http:/
- Meta_query question