• I am using the following code to show the page number for posts with multiple pages, and I created a div to style it in my post.

    <div class="postPages"><?php link_pages('<p><strong>Pages:</strong> ', '</p>', 'number'); ?></div>

    Is there any way I can make this only show up if the post has multiple pages? As it is, the div is put on the page, even if there aren’t page numbers to go in it.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Do the following:

    <?php global $multipage;
    if( $multipage ) {?><div class='postPages'><?php link_pages('<strong>Pages:</strong> ', '
    ', 'number'); ?></div>
    <?php }?>

    Thread Starter melbell

    (@melbell)

    Thanks, that’s exactly what I was looking for, I just didn’t know which variable would identify it as a multiple paged post! 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘If a Post has Multiple Pages’ is closed to new replies.