WordPress.org

Support

Support » How-To and Troubleshooting » how to hide pagination in single post

how to hide pagination in single post

  • I have some very very long post, and I divide them into multipages. Now I would like to hide pagination numbers (page 1.2.3.4.5…)from my single post pages,. Which file and lines or code should I change? Thanks for your help!

Viewing 5 replies - 1 through 5 (of 5 total)
  • You have to remove following line form content.php file (if you are using twentyeleven or twentytwelve theme)

    <?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ), 'after' => '</div>' ) ); ?>

    wp_link_pages() function list the page numbers on a single post.

    I’m using Magazine Basic, there are content.php, content-page.php, search everywhere,even single.php, just cannot find <?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ), 'after' => '</div>' ) ); ?> or anything similar to this.

    any idea where else to search?

    In this theme, the code is written in content-footer.php, remove or comment the following line:

    wp_link_pages( array( 'before' => '<p id="pages">' . __( 'Pages:', 'magazine-basic' ) ) );

    okay, it works, many thanks.

    I replaced the line above with <?php wp_link_pages('before=<div id="page-links>&after=</div>&next_or_number=number&pagelink=page %'); ?>, so it shows “before” and after instead of page 12345.

    What code can make it look like “previous …1 2 3 … next”, just like the pagination on the google search results page?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘how to hide pagination in single post’ is closed to new replies.