WordPress.org

Ready to get started?Download WordPress

Forums

how to hide pagination in single post (6 posts)

  1. legaltranz
    Member
    Posted 1 year ago #

    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!

  2. frizax
    Member
    Posted 1 year ago #

    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.

  3. legaltranz
    Member
    Posted 1 year ago #

    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?

  4. frizax
    Member
    Posted 1 year ago #

    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' ) ) );
  5. legaltranz
    Member
    Posted 1 year ago #

    okay, it works, many thanks.

  6. legaltranz
    Member
    Posted 1 year ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags