Pagination on page

Posted in: Newspaper
Post count: 159

Is there a way to put formatted code for <?php wp_link_pages(); ?> in a page? It seems you’ve coded it only for posts…

Post count: 6600

Hi,

Unfortunately the post pagination uses the wp_link_pages() function which only works on loop single.
You need a different approach fro pages or you could try to find plugin.
You can find more info about this here: http://codex.wordpress.org/Pagination

Thanks

Post count: 159

For sure the wp_link_pages() works for pages! 😉
In the standard wordpress themes (eleven, twelve…) pagination with <!–nextpage–> in pages works.

Post count: 6600

Hi,

You can try to remove this condition from pagination function then check it on pages.
I have tested the tag on post/pages/ twenty fourteen theme, result: http://screencast.com/t/74o4v00hs

Thanks

Post count: 159

The pagination for pages is not styled

This is what it looks like when I use <?php wp_link_pages(); ?> in pages

This is what pagination in a post looks like

  • This reply was modified 11 years by mbasche.
Post count: 159

Found a solution so far. 🙂
In page.php after <div class="td-page-text-content"><?php the_content();?></div>
use this

<?php wp_link_pages(array(
'before' => '<div class="page-nav page-nav-post">',
'after' => '</div>',
'link_before' => '<span>',
'link_after' => '</span>',
'nextpagelink' => ' ' . __td('Next') . ' ',
'previouspagelink' => ' ' . __td('Prev')
)); ?>

Now it’s look the same in posts and pages!

Post count: 6600

Glad you’ve managed to get this done!
Thanks for sharing!

  • This reply was modified 11 years by Lucian.
Viewing 7 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic.