Wordpress custom URLs for pagination pages

admin2025-01-07  3

I’m trying to find a way to make custom URLs for each pagination page separated by <!--nextpage--> tag. For example, if the first page is:

myblog/my-topic/

the second one will be:

myblog/my-topic/2/

Is it possible to customize this link? I want it to be:

myblog/my-topic/something/

or if it is necessary to contain number it can also be:

myblog/my-topic/page-2-something/

or

myblog/my-topic/2-something/

I was searching through a lot of plugins, but it seems none of them provide this option. It would be very useful for SEO, don’t you think? Each page URL would contain some specific keyword related to its content. I guess the best approach would be to add a parameter to <!--nextpage--> tag, containing a specific word.

Is there some plugin or known hack for making this possible? I’m using the latest WP 4.7.3

I’m trying to find a way to make custom URLs for each pagination page separated by <!--nextpage--> tag. For example, if the first page is:

myblog.com/my-topic/

the second one will be:

myblog.com/my-topic/2/

Is it possible to customize this link? I want it to be:

myblog.com/my-topic/something/

or if it is necessary to contain number it can also be:

myblog.com/my-topic/page-2-something/

or

myblog.com/my-topic/2-something/

I was searching through a lot of plugins, but it seems none of them provide this option. It would be very useful for SEO, don’t you think? Each page URL would contain some specific keyword related to its content. I guess the best approach would be to add a parameter to <!--nextpage--> tag, containing a specific word.

Is there some plugin or known hack for making this possible? I’m using the latest WP 4.7.3

Share Improve this question edited Apr 19, 2017 at 13:51 Max Yudin 6,3782 gold badges26 silver badges36 bronze badges asked Apr 18, 2017 at 0:41 geter712geter712 212 bronze badges 1
  • You can create custom rewrite rules to succeed. But there is no connection with SEO. – Max Yudin Commented Apr 19, 2017 at 14:35
Add a comment  | 

1 Answer 1

Reset to default 0

Check the 'format' argument

<?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'  => ''
); ?>

<div class="pagelink"><?php echo paginate_links( $args ); ?></div>
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736257022a406.html

最新回复(0)