Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SearchWP Live Ajax Search bbPress pre-search results template
<p class="searchwp-pre-qualify">
<strong>Please try these resources before creating a new ticket:</strong>
</p>
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php $post_type = get_post_type_object( get_post_type() ); ?>
<div class="searchwp-live-search-result">
<p><a href="<?php echo esc_url( get_permalink() ); ?>">
<?php the_title(); ?> (<?php echo esc_html( $post_type->labels->singular_name ); ?>) &raquo;
</a></p>
</div>
<?php endwhile; ?>
<?php endif; ?>
<p class="searchwp-nothing-applicable">
<a href="#">Nothing Here Helps, Create Ticket &raquo;</a>
</p>
<script type="text/javascript">
jQuery(document).ready(function($){
$('.searchwp-nothing-applicable a').click(function(){
$('.searchwp-pre-ticket,.searchwp-live-search-results').remove();
$('.searchwp-pre-ticket-hide').removeClass('searchwp-pre-ticket-hide');
return false;
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.