<?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 
				$patterns = array();
				if ( !empty( $_REQUEST['swpquery'] ) ) {
					$patterns[] = '/(' . $_REQUEST['swpquery'] . ')/i';
				}
				$title = preg_replace( $patterns, '<strong>$0</strong>', get_the_title() );
				?>
				<?php echo wp_kses( $title, array( 'strong' => array() ) ); ?>
			</a></p>
		</div>
	<?php endwhile; ?>
<?php else : ?>
	<p class="searchwp-live-search-no-results">
		<em><?php echo esc_html__( 'No results found.', 'ux-shop' ); ?></em>
	</p>
<?php endif; ?>