• I have a custom post type called properties. I have also created a search form to filter out certain posts using $_SESSION s to store the data. The form is on a custom page template, and upon submit, it goes to results page template which has my query arguments and the loop. This is working, the search form is filtering my posts appropriately.

    What i’m having an issue with, is paginate_links(), or any other pagination examples i’ve found using the wordpress methods. What happens is the pagination links will show at the bottom with the appropriate amount of pages for the filtered posts, but when you click on the next page it seems to strip all query arguments, and instead just shows a list of all properties entered, rather than the filtered posts. So say I filter it down to 2 pages of posts, and i click page 2, now I see 5 pages listing all posts instead of going to the 2nd page of the filtered posts.

    So here’s a snippet of the code im using on the results page:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    and then where i want the pagination to appear on the list page, I call the paginate() function. I’m not stuck on using the i’ve tried using the paginate_link() function in the wordpress codex, i’m tried adding this code as well and it did nothing for me:
    $wp_query->query_vars[ 'paged' ] > 1 ? $current = $wp_query->query_vars[ 'paged' ] : $current = 1;

    I’m at a loss, i’ve scoured the net for 2 days reading anything and everything about paginating wordpress posts, and nothing is working for me… can anyone PLEASE HELP?!?! If you can, i’ll love you for life 😉

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter abowmedia

    (@abowmedia)

    bump

    Thread Starter abowmedia

    (@abowmedia)

    Anyone have any ideas? I’ve seen dropped $_SESSION since it doesn’t seem to be doing anything for me… I’ve even went about trying to use pagination plugins, none of those work either.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘preserve WP_Query arguments when using Paginate_links’ is closed to new replies.