[resolved] Global variable can't work on another page with pagination (2 posts)

  1. varunkaushik23
    Posted 4 years ago #

    I was working on a template to make custom search on my custom data tables in wordpress.I also implemented the custom pagination on the search result. My search query is stored in a global variable and another global array stores the the post array. It shows the 10 results on first page but as I move to the next page through pagination its shows the empty global array.
    I also used the SESSION variables but slow down the site and taking more time to respond.
    Is there is a way to store the query and post array with global or another variables so that it can be used on another page?

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    I think the only other option would be to store this variable in the wp-options table of the database. Sessions, however, does seem to be the best way forward.

Topic Closed

This topic has been closed to new replies.

About this Topic