Created
August 12, 2014 14:19
-
-
Save jchristopher/34161c7acd6675ae504e to your computer and use it in GitHub Desktop.
SearchWP Live Ajax Search bbPress pre-search results template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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 ); ?>) » | |
</a></p> | |
</div> | |
<?php endwhile; ?> | |
<?php endif; ?> | |
<p class="searchwp-nothing-applicable"> | |
<a href="#">Nothing Here Helps, Create Ticket »</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