Created
March 11, 2015 22:00
-
-
Save wickcreative/651f9d9ea2435c3939e2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| <?php global $post; ?> | |
| <?php if ( have_posts() ) : ?> | |
| <?php while ( have_posts() ) : the_post(); ?> | |
| <?php if( $post instanceof SearchWPTermResult ) : ?> | |
| <div class="searchwp-live-search-result"> | |
| <p><a href="<?php echo $post->link; ?>"> | |
| <?php echo $post->name; ?> (<?php echo $post->taxonomy; ?>) » | |
| </a></p> | |
| </div> | |
| <?php else : setup_postdata( $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 endif; ?> | |
| <?php endwhile; ?> | |
| <?php else : ?> | |
| <p class="searchwp-live-search-no-results"> | |
| <em><?php _ex( 'No results found.', 'search results' ); ?></em> | |
| </p> | |
| <?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment