-1

Currently I’m having URL for pagination pages as:

http://www.example.com/category_name/page/2

But I need to change this URL structure as:

http://www.example.com/category_name/?page=2

etc.

any solution?

0

You may use the format argument of wp_link_pages function like this:

<?php $args = array(
  'base'               => '%_%',
  'format'             => '?page=%#%',
  'total'              => 1,
  'current'            => 0,
  'show_all'           => False,
  'end_size'           => 1,
  'mid_size'           => 2,
  'prev_next'          => True,
  'prev_text'          => __('« Previous'),
  'next_text'          => __('Next »'),
  'type'               => 'plain',
  'add_args'           => False,
  'add_fragment'       => '',
  'before_page_number' => '',
  'after_page_number'  => ''
); ?>

Its works good for me

See more https://codex.wordpress.org/Function_Reference/paginate_links

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.