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:
- filter rest api post by a acf filed
- Group Custom Posts Types in a Relation field of ACF
- Help Adding filter to Add Media button for custom post type
- The page or ad listing you are trying to reach no longer exists or has expired
- Default custom post type url
- How to build overlapping custom post_type and taxonomy rewrites without conflicts?
- Apply pre_get_posts to specific custom post type in the admin area
- Pagination URL in Custom Content Type
- how it’s possible to show from a post of a custom post type the taxonomy/terms?
- Two CPT: one is using part of the custom rewrite slug from the other
- Keep br tags from stripping
- Custom post type rewrite and wp_pagenavi interfering with each other
- Custom taxonomy archive slug overwrites static page
- Template hierarchy changes when custom post-type permalink leverages custom taxonomy
- Group based routing and administration
- Adding Custom Taxonomy Along-with Post Name in Post Type Permalink
- Add filter button to custom post type in admin area
- Enable shortcodes on custom post type
- Filter between Custom Posts depending on meta_value
- Associate custom CPT with another CPT’s taxonomy and rewrite permalinks
- Custom Post Type Rewrite – Page Not Found
- Grouping and paging CPT events by month with custom field date
- Permalinks for a custom post type – with a page template (custom query) and taxonomy archive
- how to use two permalinks for one custom post type based on categories
- Custom Post Type rewrite url to /category/pagetitle [duplicate]
- Highlight a Post on archive page if it has a new comment?
- Creating adminable dynamic filtering on custom post type
- WordPress custom post type rewrite rule matches all pages returning 404
- page not found for example.com/custom-post-name
- Paging not working for hierarchical custom post type
- Get the custom post type slug but remove the rewrite prefix?
- Adding Information To All Posts Screen
- Menu disappears with custom post type link
- Dropdown switching subcategories portfolio
- Filter Content on all Post Types
- Filter wp_dropdown_categories Per Post Type
- Custom post type with Filter and Page Nav
- Rewrite for custom type and custom taxonomy
- redirect old post type url to new structure url
- Sorting on Taxonomy in archive page
- Converting a checkbox filter for custom fields to a dropdown
- add current-menu-item to multiple custom post types
- Filter custom post type by tags
- Multiple Custom Post Type permalink issue
- Custom Rewrite Tag Structure
- Custom Post Types and rewrite rules – One CPT works and a cloned one doesn’t
- Archive page for a custom post type using WPML
- Custom Search Template for Custom Post Types
- Why won’t this rewrite rule work?
- Exclude Custom Post Type from shared Custom Taxonomy
- Custom post type child page 404
- using ACF datepicker to filter posts on a page
- Permalink clashing with Custom Post Type rewrite rule
- Hook only specific post type
- Rewrite rules causing hole
- Parent cpt/child custom post type URL permalink relationship
- Custom post type rewrite with_front
- CPT Template Not Showing – Getting 404
- Restrict a filter to a custom post type. Am I doing this right?
- Diffrent search templates for different post types
- How to rewrite CPT-Permalinks the correct way (incorporating meta-box-data)?
- How to make nested custom post type slugs work
- Rewrite Rule & Regex – Extract ‘cat-name’ and ‘page-number’ from http://domain.com/custom-post-type/category/cat-name/page/page-number
- CPT Template Not Showing – Getting 404
- How to filter posts by categories?
- Adding rewrite rules to Custom Post-type mixed with Taxonomy
- What is the proper way implement a global $wp_rewrite?
- rewrite rules add a folder in the path
- Display results from two Custom Post Types in page template
- Permalink of Custom Post Type
- Canonicalization + Custom Post Types not working as expected
- Ideal top-level slug methods
- Custom Taxonomy in Permalink from post type
- Custom post type permalink structure
- How do I filter a custom post type loop by a field?
- A to Z list for custom post types
- Rewrite a filter as shortcode (or something like that) to use anywhere in CPT
- add_filter > posts_where works partially
- Simple Share Buttons Add Plugin and Custom Post Type
- 404 Error On Custom Taxonomy Pages 2, 3, etc
- add_rewrite_rule not working in Custom Post Type UI Plugin
- Can WordPress show posts based on a button that the user clicked 2 pages back?
- Trying to set up a range filter for related custom post types
- CPT Archive Pagination – Page not found
- How to add custom permalink struct with DYNAMIC author to a Custom Post Type
- Filter page ID outside the loop and order
- add_rewrite_rule not working with custom post type
- Url rewrite with custom post type and taxonomy
- When Attempting to Filter Plugin Generated Content Using Filter post_type_link, Permalinks Are Not Modified
- Custom archive URL as a subfolder of the custom post type slug
- Same slug for Custom Taxonomy archive and CPT archive – Rewrite rule not working
- Two Permalinks with one Taxonomy (custom taxonomy) and (custom post type -> custom taxonomy)
- What is the best way to relate different custom post types?
- Change CPT Edit Target Link for Admin List
- Dynamic WordPress rewrite rules for multiple custom post types
- Add Custom Taxonomy Terms as CSS Classes for CPT Posts in an Elementor Loop Item Template
- Add post id to url instead of WordPress default -2 suffix
- 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
- coloring row’s background based on custom field value
- Custom post type template not loading from plugin