Wordpress Themes and Page-links

Wordpress offers a cool feature to split a single post into different web pages, by using <!—nextpage—> keyword. The problem arises when you use a theme different from the default one: that’s why many theme writers forget to add the right code to the theme;

if you have this problem, follow these steps:

  1. Go to the theme directory (DOC_ROOT/wp-contents/themes/yourtheme)
  2. Look for file named single.php
  3. Look for the template tag named the_content
  4. Add a new line below and attach the following istructions:
?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ',

'after' => '</p>', 'next_or_number' => 'number')); ?>

<?php wp_link_pages(array(‘before’ => ‘<p><strong>Pages:</strong> ’,‘after’ => ‘</p>’, ‘next_or_number’ => ‘number’)); ?>

Try to reload the single post page and enjoy page-links.

For further informations about page-links, read this document.

Comments