I found the solution.
First, in functions.php:
function mg_news_pagination_rewrite() {
add_rewrite_rule(get_option('category_base').'/page/?([0-9]{1,})/?$', 'index.php?
pagename=".get_option("category_base').'&paged=$matches[1]', 'top');
}
add_action('init', 'mg_news_pagination_rewrite');
and then in wordpress, settings> Permalinks changes must be saved
Related Posts:
- Modify previous and next text from pagination links
- Rewriting search and pagination base
- WooCommerce – Customer Order History Pagination
- Getting rid of role=”navigation” in the Home Page Pagination
- Search not showing all results
- Custom Pagination is Broken
- Pagination on Custom Post
- Prev/Next Links Broken on Static Front Page Pagination
- Custom query vars filters problem with pagination
- How to add PHP pagination to wordpress
- Pagination Not Working (pages duplicating content)
- How can I get my pagination loop to display the correct number of total pages?
- How to fix blank pagination links?
- Pagination not displaying
- /page/2/ redirect to 404
- start_lvl Ignored in Custom walker_nav_menu
- Enforcing password complexity
- Getting paginate_links() ‘end_size’ to display none
- Customize default settings on new sites on multisite
- How do I make my function add variables/values to the $post object?
- Check if a menu is empty?
- Dynamically change feature image in customiser
- Change comments form title on a page by page basis
- Creating wordpress user registration form
- Get the title before comma
- category not display in word press grammatically
- Setting up the child theme so as to enable right-to-left WordPress?
- Getting a fatal error while updating
- Hooking new functions to actions + passing parameters
- “Can’t use function return value in write context” error
- Display 4 chronological posts starting with a random post
- get understrap pagination to work with custom query
- my function doesn’t return my post from today
- How to break down importing of feeds
- get_the_terms – only top level
- Have CSS Class Added with `is_page()` WP function
- Slide in Panel WordPress Post
- Use wp_get_recent_posts with search term
- Calculations in functions.php [closed]
- comments_number display outside specified span
- Choose To Display Post Views With An Options Panel
- Prevent Data Resubmission On Page refresh
- Get_avatar filter?
- Passing the custom field values in the wp_get_current_user array function
- Get value from shortcode to do something
- PHP 8, AJAX mail form to function.php doesn’t work
- Ajax request not sending to server and returning – wp-admin/admin-ajax.php 400
- How to create a php variable using WordPress the_title() function
- Can’t find infinite loop cause
- how to make custom ajax handler?
- How to disable controls in theme customizer?
- register_taxonomy() take much queries
- is there a benefit in using a constant over get_stylesheet_directory_uri?
- WooCommerce Tabs [closed]
- ::before on open/close function [closed]
- REQUIRED: get_bloginfo(‘template_url’) was found in the file search.php. Use get_template_directory_uri() instead
- How to check if a PHP string is different than meta field?
- Displaying posts based on category
- Creating a mobile site by adding a new class to the body tag from functions.php
- Export Form Data to a CSV then send it as an attachment – contact form 7
- Issue with fetching mysql data and displaying results via shortcode in webpage
- Noindex Posts From Certain Authors In WordPress
- Template Loop – add switch case php
- Show all tags within a category?
- How to Handle Going Backwards in Navigation When Referrer in PHP/JavaScript won’t work?
- This function is deprecated; use mysql_real_escape_string() instead
- Image rotation issue (horizontal picture uploading as vertical) — Exif issue?
- How can I alter this code to accept a slug as well as an ID?
- Enqueueing a code block from an options framework
- Adding a ‘style=’ bit to image_send_to_editor output
- Post Views Code Hacks
- Closing WP_LINK_PAGES DIV ID w/After Argmuent
- Auto create Nextgen Gallery on post creation [closed]
- Hide media for non logged in users
- Adding an “Upgrade Subscription” button to an Elementor page
- Jetengine Forms – Media upload path
- Custom function that re-writes page title breaks when the Yoast plugin is activated
- is_front_page is not working in my functions.php
- Is it possible to update the dataset using update_post_meta
- update_user_meta as multiple value but with same meta key
- Hide payment method based on user role AND minimum cart value
- Update $wpdb query with AJAX
- How to bind each “the_content” elements to a custom variables
- Permalink changes after several minutes after saving post
- how to use auth_redirect() redirect visitor to login page if they are not login when they click account and order page?
- Allow Comments by Default for Multiple Post Types
- How to get User Avatar Image with link to Author and User name in Html Title tag?
- Add a leading zero to pagination
- WP HTTP API call response
- Fatal error when using array_diff() function inside of wp_update_nav_menu hook?
- Private messaging – Getting and displaying the avatar/url of a message recipient
- rewrite_rule – working fine but broken for pagination
- Postmeta not saving
- Fix My Custom Function: Remove Automatic
- Hide the content before the more tag in the “single page”
- WP Debug enabled Undefined index error in a widget
- how to loop through blog posts in php
- a problem in class in class-wp-hook.php
- change title of page dynamically
- Custom plugin doesn’t show in admin menu – when code added, displays an empty page