** 固定ページの内容 **
HTML
1teratail172941-1
2<!--nextpage-->
3teratail172941-2
4<!--nextpage-->
5teratail172941-3
6<!--nextpage-->
7teratail172941-4
** 固定ページのテンプレート概要 **
PHP
1/* Start the Loop */
2while ( have_posts() ) :
3 the_post();
4
5 wp_link_pages(
6 array(
7 'before' => '<div class="page-links">' . __( 'Pages:', 'twentynineteen' ),
8 'after' => '</div>',
9 )
10 );
11
12endwhile; // End of the loop.
固定ページの内容と固定ページのテンプレートファイルが以上のつくりであるという前提だと、wp_link_pages
フィルターフックを利用して、ページネーションを書き換えるのがよいと思います。
具体的なコードは今は提示できませんが、以下のコードが参考になると思います。
PHP
1add_filter('wp_link_pages', 'teratail172941_kaatoxuun', 10, 2);
2
3function teratail172941_kaatoxuun( $output, $args )
4{
5 global $page, $numpages, $multipage, $more;
6
7 var_dump($page);
8 var_dump($numpages);
9 var_dump($multipage);
10 var_dump($more);
11
12 var_dump($output);
13 var_dump($args);
14
15 return $output;
16}