Made script work on WordPress subfolder installs

Fixed loading to work for sub-folder installs. Also fixed site specific
query