Skip to content

Instantly share code, notes, and snippets.

@QROkes
Last active November 29, 2017 15:13
Show Gist options
  • Save QROkes/2071bbf1c7272844cd45 to your computer and use it in GitHub Desktop.
Save QROkes/2071bbf1c7272844cd45 to your computer and use it in GitHub Desktop.
Opensearch XML Code (Wordpress)
/* Insert OpenSearch Code (Wordpress) */
add_action( 'wp_head', 'qr_opensearch' );
function qr_opensearch () {
echo '<link rel="search" type="application/opensearchdescription+xml" href="/wp-content/themes/qrokes/opensearch.xml" title="QROkes.com" />' . "";
}
<!-- Opensearch -->
<?xml version="1.0"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<ShortName>QROkes.com</ShortName>
<Description>QROkes.com</Description>
<Image height="16" width="16" type="image/x-icon">http://qrokes.com/favicon.ico</Image>
<Url type="text/html" method="get" template="http://qrokes.com/?s={searchTerms}" />
<moz:SearchForm>http://qrokes.com/</moz:SearchForm>
</OpenSearchDescription>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment