Note that there are some explanatory texts on larger screens.

plurals
  1. POWordpress search results on external page
    text
    copied!<p>I have a custom search engine on a non-wordpress page. This search engine searches a database for a city (specified by a text input) and then returns the relevant information about that city and displays it on the page. </p> <p>What I want to do now, is to below those results, display the results of a wordpress search of the same term on a blog that resides on the same server/domain. So basically I want to show the same results that a wordpress search of that keyword would return, but I want to display them on a non-wordpress page, not in the blog's theme.</p> <p><strong>What I have:</strong></p> <p>a variable holding a search term, the search term has already been shampooed and conditioned to be search engine friendly.</p> <p><strong>What I don't want to do</strong></p> <ul> <li>I don't want to use an iframe and have the blog template be displayed on the page.</li> <li>I can't have a secondary search box. I need to somehow use the value of the variable that I have, I can't ask the user to submit a second form or anything.</li> </ul> <p><strong>My ideas so far</strong></p> <p>Is there a way to run the wordpress search function and grab the data that it returns? I've gotten as far as including wp_blog_header.php on my static page so that I can make use of the wordpress functions.</p> <p>Or would it be better to write a function that duplicates what the wordpress search does on the wordpress databases, but returns the data in a way that I can use?</p> <p>Or is there a different approach that I should take for this that I've overlooked? Thanks!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload