Ended up like this. Made this changes and it worked:
changed:
'base' => str_replace($big,'%#%',esc_url(get_pagenum_link($big))),
into:
'base' => get_permalink( $post->post_parent ) . '%_%',
And changed:
'format' => '?paged=%#%',
into:
'format' => 'paged=%#%',
Then added a filter with rewrite tag and rule:
add_filter('init', 'post_gallery_add_rewrite_tag_rule_2022');
function post_gallery_add_rewrite_tag_rule_2022() {
add_rewrite_tag('%current%','([^&]+)');
add_rewrite_rule('([^/]+)/paged=/?([0-9]{1,})/?$', 'index.php?name=$matches[1]&paged=$matches[2]', 'top');
}
Then (after uploading functions.php) in WordPress admin panel:
Settings -> Permalinks -> [ Save Changes ]
Related Posts:
- WordPress Gallery shortcode with pagination
- How to implement a slideshow on WP similar to these examples?
- WordPress default gallery pagination when in page (is_page)?
- Need help with get_posts pagination
- WordPress /page/2 404 pagination problem – what to do?
- Paged posts – how to use numbers and next/previous links?
- how to get pagination link url?
- add_rewrite_rule – working fine but broken for pagination
- Check if on last page of paginated post using wp_link_pages
- How to paginate a list of tags
- How do I sort multiples pages?
- WordPress pagination on custom script
- Broken pagination
- wordpress Static Page pagination
- pagenavigation not showing the next page just linking back to the main page [closed]
- Paginate get related post by author function
- How to use pre_get_posts?
- Keep Pagination in Tabs
- Need help understanding pagination parameters
- redirect pages with no content, instead of 404 error, using max_num_posts?
- WordPress API returns empty page when page is less than X-WP-TotalPages
- Custom query in archive.php with pagination nightmare
- Display post links under month in paginated archive
- Pagination (page/2/) displaying 404 on archive pages
- How to use “offset” to paginate get_users?
- Limited number of paging to 10 “pages: 1 … 10”
- remove_query_arg() on rewrite rule
- Hide featured post on second page
- I cannot get pagination to work on my home page code. it keeps displaying the same posts
- How to get “last year from [spec year] that has posts”?
- Fetching more posts in WordPress via AJAX
- Pull Random Attachments With Pagination
- AJAX pagination offset returns same post on adjacent pages
- 404 on pagination but with a strange twist (error 404 only when there is single post on the second page)
- WordPress loading index page instead of archive.php
- How can I paginate a list of related posts?
- tag.php pagination and query_posts()
- Add additional first page, last page links to the_posts_pagination()
- Add icons in paginate_links()
- How can I use var php with javascript to build custom page? [closed]
- WordPress single page template, custom post type, pagination orderby title – alphabetical order
- Exclude certain post formats from pagination
- How to use pagination on costum post type
- Single Page Views and Pagination View Depending on URL Query
- Category lists page foreach Paging
- Archive pagination not working
- Issue on single.php pagination WordPress
- Using Ajax in the prev_posts_link and next_posts_link
- Adding range to wp_link_pages()
- How to set up pagination [closed]
- WordPress triggers 404 on page 2 for custom search query
- Search page pagination does not work
- Pagination 404s on custom query
- Customise wp_List_pages to output a UL LI
- Custom wp_link_pages for paginated posts | Next page randomly
- Pagination in home page for a custom loop loads same content
- Pagination not working with custom post type
- Displaying the author of next and previous posts in pagination?
- How to ignore pagebreaks for RSS feed?
- Pagination For Table Rows on a page?
- Universal CPT archive template and half working pagination
- Problem with older entries in homepage
- remove $_GET-parameter from WP_List_Table::tablenav
- WP Page Navi. 404 error when using posts per page parameter [duplicate]
- Pagination for previous page/next page (with more than one post/page)
- Error 404 on pagination on homepage
- Pagination Adding Numbers in Strange Fashion
- Pagination for custom post types
- Pagination in author, category, archive and tags pages does not work
- WordPress pagination with wp_query_columns
- How can I paginate results from get_children
- Setting up Pagination with twentytwelve_content_nav
- Why can i add /page/674874 (or any number) to a URL and it still pulls up that page?
- WordPress blog pagination not working
- How to add numbers pagination to this blog page?
- how can I do numeric pagination?
- Why next_posts(); function does not work inside header.php?
- empty pages on pagination with meta query
- I would like to fix a problem with post pagination: i can only see the url title (prev – next) but title is truncated
- Override the WordPress default pagination markup
- Pagination with Metaboxes or Custom Fields
- How To Get ‘Custom SEO Titles’ For Each Paginated WordPress Page?
- 2 Columns with Independent Pagination
- Prevent WordPress to remove query vars from url
- Google Indexed sub pages in wordpress pagination in post
- Pagination reloads first page but has proper url
- Paginate Links function: Page 1 doesn’t work
- How to display most viewed posts without any plugins
- Search engine not working
- How to devide post into more than one page using ?
- pagination for blog landing page
- Blog Page pagination not working, loads Page 1 each time [duplicate]
- Pagination is not working correctly there is this wierd looping
- Media library only show 2 items per page?
- margins in between pagination links [closed]
- Page navigation not working correctly on index but only on categories
- How to split long posts in multiple pages in twentysixteen
- Duplicating pagination on second page
- Separate page for pagination possible?
- Why does WordPress keep directing or forcing my pagination?