Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php use Roots\Sage\Titles; ?>
<div class="page-header page-header--no-cover">
<div class="container center" itemtype="http://schema.org/WebSite">
<h1 class="page-title"><?= Titles\title(); ?></h1>
<meta property="url" content="<?php echo esc_url( home_url( '/help/documentation/' ) ) ?>"/>
<form role="search" method="post" class="search-form wedocs-search-form"
itemprop="potentialAction" itemscope itemtype="http://schema.org/SearchAction"
action="<?php echo esc_url( home_url( '/help/documentation/search/' ) ) ?>">
<meta itemprop="target" content="https://freemius.com/help/documentation/search/{query}/"/>
<div class="wedocs-search-input">
<input type="search" class="search-field"
itemprop="query-input"
name="query"
tabindex="1"
placeholder="<?php _e( 'What can we help you with?', 'freemius' ) ?>"
value="<?php echo get_search_query() ?>"
title="<?php echo esc_attr_x( 'Search for:', 'label' ) ?>"/><button type="submit" tabindex="1"><span><?php _e( 'Search', 'freemius' ) ?></span></button>
</div>
<h2><?php _e('Search Freemius documentation using terms like "Deployment", "API", or "Payouts".') ?></h2>
</form>
</div>
</div>
<script type="text/javascript">
(function ($) {
$('.search-form.wedocs-search-form').on('submit', function () {
var search = $(this).find('input').val().toLowerCase().trim();
if ('' === search){
return false;
}
$(this).attr('action', $(this).attr('action') + encodeURIComponent(search) + '/');
});
})(jQuery);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment