If you want to use WordPress outside of WordPress you simply need to require() wp-load.php, which is found in the root of the WordPress installation. Since your site is in a sub-directory, you’ll want to look in that folder. Then you’ll call the search form where ever you want it. So something like this:
<?php
require( 'subfolder/wp-load.php' );
get_search_form();
?>
Things to pay attention to…
1) The path inside the require()
function will change according to where you are relative to where the wp-admin.php file is. Also, replace “subfolder” with your actual folder name :).
2) The require()
function need only be called ONCE per page it’s used on. In fact, I use require_once() as it does the same thing, but does a check to make sure the file hasn’t already been called. Just a safety measure on my part.
3) Though the require()
function CAN go anywhere, it’s generally good practice to place it a the very top of the file. This means you would separate the get_search_form()
function from the require()
function, as you’ll want the search form somewhere appropriate on the page
Let me know if this makes sense. Good luck.