Your regex cannot work: $wp_rewrite->preg_index(3)
doesn’t match anything, because you capture only one part in '/([0-9]{4})/?$'
, not three.
Try to add the page parameter:
$pagination_base = $GLOBALS['wp_rewrite']->pagination_base;
$month_archive = array(
$myqueryslug . '/([0-9]{4})(' . $pagination_base . '/(\d+))?/?$' =>
'index.php?year=" . $wp_rewrite->preg_index(1)
. "&post_type=" . $myqueryslug
. "&paged=' . $wp_rewrite->preg_index(3)
);
I haven’t tested it, just see it as a hint for where to look.
Related Posts:
- Where, When, & How to Properly Flush Rewrite Rules Within the Scope of a Plugin?
- Filter by custom field in custom post type on admin page
- How can I remove the “Add New” button in my custom post type?
- CPT Template Not Showing – Getting 404
- How to remove Filters from post admin page?
- Adding a drag and drop re-ordering from a custom post type default list [closed]
- How can I filter posts by post_parent in the admin?
- How do I filter the excerpt metabox description in admin?
- How do I Filter Custom Post Type by Custom Taxonomy in the newest WordPress RESTful API?
- Adding meta values to permalink
- Filter by custom Field for Custom post type Admin Listing
- Remove wpautop from all posts/pages except my custom post type
- Remove date and category filters when editing custom post types
- Taxonomy terms with edit/filter link in wp-admin, in the list of custom posts
- Make the ‘all’ filter default instead of ‘mine’ in a custom post type
- How to Add Pages Under Custom Post Type URL Structure?
- How to check if last uri segment is a custom post type or taxonomy term?
- Exclude custom function content from certain pages
- Pagination Doesn’t Work
- Permalinks using event date (year & month) instead of publication date
- Filter get_categories() for taxonomy term in WordPress
- WP Rewrite Rules – Custom post type & taxonomy
- Multiple post types in archives (filter?)
- Remove base slug in CPT & CT, use CT in permalink
- Highlight nav menu terms
- Want to filter only parent post in admin area
- Filters post in admin with dropdown select, custom post type
- Admin List Dynamic Heading
- What is better: Custom Fields vs Custom Taxonomies with Terms for perfomance, scalability and better user experience
- Disabling post_type in URL
- single-{post_type}.php is not loaded despite flushing rules
- Custom Permalink Tag breaks Pagination
- Custom Permalink for Taxonimie and Custom Post Type
- Rewrite numeric ID parameter for hierarchical custom post type
- Adding the taxonomy before the custom post type
- Pagination problem
- Custom post type with slug for plural (archive) and for single
- Add html to cpt main page / admin edit.php
- register_taxonomy and register_post_type does not work [closed]
- Filter categories of posts with checkboxes
- Permalink Structure CPT With Custom Taxonomy Fails
- Rewrite WordPress URL to show CPT meta field data
- Custom Post Type won’t Register
- How to query custom post types posts filtered by multiple custom taxonomies through a form selection
- How can I see a list of my Custom Post Types of the last term I was in?
- Can’t get custom rewrite tag, query var, permastruct (permalink structure), and rewrite rule to work properly together
- How to Filter custom post type by taxonomy?
- creat filter with wp_query
- A method for ordering mixed dates in search result loop (theory only, no actual code)
- Customize Custom Post Type URL
- Filter hierarchical custom post type admin page by parent, and include children & grandchildren
- Versioned Custom Post Type (Not the same as revisions)
- Hide or disallow default custom post type url?
- A case for Hierarchical Custom Posts
- Rewrite CPT child page URL to support query var
- Filter Posts from the Main Query
- Categories filtering in new post
- Flush Rewrite Rules when new site is created on network
- Pretty URLs and custom post types
- Specific routing for CPT
- Rewrite rule for Custom post type Monthly and Yearly archive
- Best structure / rewrite rules to achieve the following url
- Properly flush rewrite rules on plugin activation
- wordpress remove views from action links in a custom post
- Custom Rewrite Rule for Custom Post Type with URL Param
- WordPress custom slug rewrite
- Filter posts by tax (dropdown) and meta value
- Custom post type paging 404 error
- sortable columns for multiple custom post types not working
- I need to add a filter to prepend the term ‘National – ‘ to the post title if the post is tagged to multiple states
- Set parent for custom post type archive rewrite url
- Custom Endpoint For Custom Post Type from Child Theme
- Catch and display error on save_post action
- Rewrite rules for custom post type
- Custom taxonomy and post type rewrite rules
- Display custom post front end filter by ACF equals current user
- Url Rewriting a dynamic wordpress page with parameters
- Custom Permalink For Custom Post Type – Working Fine But Broken For Pagination
- Best way to fix bad count on All | Mine | Published
- Redirect Custom Post Type from Child Taxonomies
- How to use multiple orderby conditions on query search results? (orderby one post type, relevance)
- Pagination URL in Custom Content Type
- Add filter button to custom post type in admin area
- Grouping and paging CPT events by month with custom field date
- redirect old post type url to new structure url
- Multiple Custom Post Type permalink issue
- Custom Post Types and rewrite rules – One CPT works and a cloned one doesn’t
- Exclude Custom Post Type from shared Custom Taxonomy
- Custom post type child page 404
- How to rewrite CPT-Permalinks the correct way (incorporating meta-box-data)?
- CPT Template Not Showing – Getting 404
- How to filter posts by categories?
- What is the proper way implement a global $wp_rewrite?
- Display results from two Custom Post Types in page template
- 404 Error On Custom Taxonomy Pages 2, 3, etc
- CPT Archive Pagination – Page not found
- How to add custom permalink struct with DYNAMIC author to a Custom Post Type
- Change CPT Edit Target Link for Admin List
- Add Custom Taxonomy Terms as CSS Classes for CPT Posts in an Elementor Loop Item Template
- Need help creating a WordPress site that has a landing page and sub pages for an area (for example, “London”). Website will have 100’s of areas