• Resolved HolyBatNipplesBatman

    (@holybatnipplesbatman)


    HI Guys,

    noob here, I have a small problem i can’t make work.

    when I’m at the last page of an article (page 5of5), the next button would be there but clicking next would take me to Page 1 of the next article. Similarly, if I’m at Page 1, there would be a previous button which would take me to the previous article.

    this is my code it goes trough the pages and on page 5 the Next disappear.
    I want it to show even on last page and then when i click Next it redirect to the next article. same for previous.

    <?php wp_link_pages(array(‘before’ => ‘<span id=”prev-link” class=”next-prev-link”>’,’after’=>'</span>’, ‘previouspagelink’ => __( ‘Previous’ ),’nextpagelink’ =>__( ” ), ‘next_or_number’=>’next’)); ?>
    <?php wp_link_pages( array( ‘before’ => ”, ‘after’ => ” ) ); ?>
    <?php wp_link_pages(array(‘before’ => ‘<span id=”next-link” class=”next-prev-link”>’,’after’=>'</span>’, ‘previouspagelink’ => __( ” ),’nextpagelink’ =>__( ‘Next’ ), ‘next_or_number’=>’next’)); ?>

Viewing 1 replies (of 1 total)
  • Thread Starter HolyBatNipplesBatman

    (@holybatnipplesbatman)

    i fixed my problem but still need to work on the style

    <div class=”page-link”>
    <?php
    if($page === 1)
    {
    previous_post(‘%’,’Previous’,”);
    }
    ?>
    <?php wp_link_pages(array(‘before’ => ‘<span id=”prev-link” class=”next-prev-link”>’,’after’=>'</span>’, ‘previouspagelink’ => __( ‘Previous’ ),’nextpagelink’ =>__( ” ), ‘next_or_number’=>’next’)); ?>
    <?php wp_link_pages( array( ‘before’ => ”, ‘after’ => ” ) ); ?>
    <?php wp_link_pages(array(‘before’ => ‘<span id=”next-link” class=”next-prev-link”>’,’after’=>'</span>’, ‘previouspagelink’ => __( ” ),’nextpagelink’ =>__( ‘Next’ ), ‘next_or_number’=>’next’)); ?>
    <?php
    if($page === $numpages)
    {
    next_post(‘%’,’Next’,”);
    }
    ?>
    </div>

Viewing 1 replies (of 1 total)
  • The topic ‘pagination next/previous goes to next article.’ is closed to new replies.