kaniosrn-j
11/21/2017 - 11:57 AM

WordPress - Search Form Display on Same Page

<?php

$args  = array(
					'post_type'        => $post_type,					
					'posts_per_page'   => 6,
					'suppress_filters' => false, // important!
					'post_status'      => 'publish',
					'paged'            => $paged,
					's'                => $_REQUEST[ 'search' ],
					'rewrite'          => array(
						'with_front' => false,
					)
				);
?>

<!-- Search Form -->
<form method="get" id="searchform" action="<?php echo esc_url( get_permalink( get_page_by_title( 'Page_Template' ) ) )?>">
	<input type="text" class="field" name="search" id="search" placeholder="Search by keyword..." />
	<input type="submit" class="submit" name="submit" id="searchsubmit" value="Search" />
</form>