WordPress.org

Ready to get started?Download WordPress

Forums

Linchpin - PrevNextPage
[resolved] Looping really? (9 posts)

  1. Agnes
    Member
    Posted 1 year ago #

    I was happy to find this plugin as I was formerly using the normal
    'previous_post_link function' with pages that was rendering strange order (by date?)
    This one seems work much better, however I don't seem to get the full loop...
    For example, this 1st subpage of 'history' does not manage to find a previous page - it should be parent though. I don't know why...
    http://www.morija.co.ls/festival/history/about/
    And this last supgae of a section can't get to the next section
    http://www.morija.co.ls/museum/outreach-and-education-programme/
    Is it because I have not ordered my pages correctly? What is theloop normally based on?
    Thanks
    Agnes

    http://wordpress.org/extend/plugins/linchpin-next-page-link-previous-page-link/

  2. aware
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Agnes,

    Typically it SHOULD loop based on the page hierarchy and page order. Let me dig into it and see if something is deterring it finding the next sections. I should be able to look into this a little bit later today for you. Sorry for not getting back to you sooner for some reason I never get notifications when someone submits a support request.

  3. Agnes
    Member
    Posted 1 year ago #

    Thanks Aaron! Just tell me if you need something more my side to find out.

  4. aware
    Member
    Plugin Author

    Posted 1 year ago #

    No problem, Are you using the shortcode or the functions? Additionally are you passing any attributes in either scenario?

  5. Agnes
    Member
    Posted 1 year ago #

    I am using the functions.

    I put this in a single-post.php:

    <!-- PAGINATION -->
    <div class="other_posts">
    <?php previous_post_link( '<span class="prevp">%link</span>'); ?>
    <?php next_post_link( '<span class="nextp">%link</span>');	  ?>
    </div>

    And that in page.php:

    <!-- PAGINATION -->
    <?php
    if ($display_posts != "1") {// except if after blog list
    echo '<div class="other_posts">';
    echo '<span class="prevp">'; 	echo previous_page_link(); 	echo'</span>';
    echo '<span class="nextp">'; 	echo next_page_link(); 	echo'</span>';
    echo '</div>';
    } ?>

    In other instances (homepage & section pages where a list of posts has been proposed), the pagination looks alike but is using different functions to send to the blog.

  6. aware
    Member
    Plugin Author

    Posted 1 year ago #

    Okey doke. In order for it to loop we need to tell it to do that in an argument. I've made some changes below. Try it out and let me know.

    <!-- PAGINATION -->
    <?php
    if ($display_posts != "1") {// except if after blog list
    echo '<div class="other_posts">';
    echo '<span class="prevp">'; 	echo previous_page_link( array( 'loop' => true ) ); 	echo'</span>';
    echo '<span class="nextp">'; 	echo next_page_link( array( 'loop' => true ) ); 	echo'</span>';
    echo '</div>';
    } ?>

    On a separate but related topic. Your code could be optimized a little bit. You don't necessarily need all of those echos for your html content

    <!-- PAGINATION -->
    <?php if ($display_posts != "1") : // except if after blog list ?>
    <div class="other_posts">
        <span class="prevp"><?php echo previous_page_link( array('loop' => true) ); ?></span>
        <span class="nextp"><?php echo next_page_link( array('loop' => true) ); ?></span>
    </div>
    <?php endif; ?>
  7. Agnes
    Member
    Posted 1 year ago #

    In one word: IT WORKS :)

    And thanks for the php correction: I am not a developer, just happy when it works and learning from bits of code I manipulate. This way obviously makes things easier. One more thing I've learned today!

    Re the loop in array, had I missedf sthg in the documentation or it is just because you know better!?

    Agnes

  8. Agnes
    Member
    Posted 1 year ago #

    PS: thanks a lot for the support and nice plugin, I'll definitely use it again.
    Would be great you get your WP notificatiosn work, itt can save one's life :)

  9. aware
    Member
    Plugin Author

    Posted 1 year ago #

    No problem, I will be sure to update the documentation to be a bit clearer. I guess it's cause I "know better" haha but that's only because I wrote it. I think the readme.txt defines it but I can add it to the FAQ for future reference. Thanks for the feed back and glad I could help.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.