Support » Everything else WordPress » Global variable can't work on another page with pagination

  • Resolved varunkaushik23

    (@varunkaushik23)


    Hi,
    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?

Viewing 1 replies (of 1 total)
  • esmi

    (@esmi)

    Forum Moderator

    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.

Viewing 1 replies (of 1 total)
  • The topic ‘Global variable can't work on another page with pagination’ is closed to new replies.