This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

return the search results in an array of post ids

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #37489
    apbalice71apbalice71
    Participant

    Hi, is it possible to return the search results in an array of post ids? We would like to see if we can use it in the post__in argument of WP_Query.

    #37490
    apbalice71apbalice71
    Participant

    You cannot access this content.

    #37500
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    Well, you are running a live search there – even if there was a way to get those IDs, the search is not yet started during the page load. You could only fetch the post IDs via front-end javascript, then probably run an asynchronous request to send the IDs as query arguments, fetch the data, and replace the widget.
    I am not sure if I recommend doing this, unless you have a very strong experience with both back-end and front-end coding, or have a good developer of doing that.

    #37512
    apbalice71apbalice71
    Participant

    You cannot access this content.

    #37530
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.