WordPress.org

Ready to get started?Download WordPress

Forums

Sort only works on first page (2 posts)

  1. admin@norris-stevens.com
    Member
    Posted 1 year ago #

    I am using a drop-down to sort posts by title, meta_value, etc. However, the sorting feature only works on the first page. The second page displays the default order rather than continuing the order from page 1. I am using wp-pagenavi for pagination. Any ideas what would be causing this error?

    Here's a link to the code:

    http://pastebin.com/AwSmMPtM

    Thanks so much.

  2. vtxyzzy
    Member
    Posted 1 year ago #

    I think the problem is that the form is submitted only for the first page. The second and following pages do not get the form, and so use the default sort order.

    I believe that you will need to add arguments to the links to the navigation to pass along the sort information from the first page. I am not sure that this can be done with wp_pagenavi(), and it requires special coding for previous/next_posts_link().

    Here is a link to another thread that might help: http://wordpress.org/support/topic/adding-an-anchor-to-previous_post_links-and-next_post_links?replies=2

Topic Closed

This topic has been closed to new replies.

About this Topic