0

I know how to use <!--nextpage--> to break the page in to multiple pages from wordpress admin area. But i want to use that page break using theme single.php file.

I'm using custom fields to design my single post template and after few fields i want to put <!--nextpage--> to break the page. But the post is ignoring the page break and showing all the content in single page only. How can we integrate put the <!--nextpage--> in theme programatically?

here is my single post template

<?php
get_header();
echo the_title();

echo get_field('moviename');
echo get_field('moviedescription');
?>

<!--nextpage-->

<?php
echo get_field('movienews');
echo get_field('moviegallery');
?>

<!--nextpage-->

<?php
echo get_field('movieinfo');
echo get_field('moviesongs');
?>

<!--nextpage-->

<?php
echo the_content();

get_footer();
?>

in the above code, <--nextpage--> is not working as it should.

  • 1
    Can you update your question with the contents of your single.php? – TheDeadMedic Dec 6 '16 at 14:31
  • Updated, please have a look once. – Anvy Dec 7 '16 at 6:37
  • Ahh I see - yes, <!-- nextpage --> only works in the post content editor - you can't just stick them in your template and expect it to work! – TheDeadMedic Dec 7 '16 at 10:12

Your Answer

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

Browse other questions tagged or ask your own question.