right now i have a problem in the search result page (search.php) the result is shown by the index page template not its template and it display all the posts despite it have what the searcher enter or not
my index.php page
<?php get_header(); ?>
<?php
$search = $_get['search'];
$args = array(
'post_title_like' => $search
);
$res = new wp_query($args);
if ($res -> have_posts()){
while ($res -> have_posts()) {
$res -> the_post();
?>
<!--start section 1-->
<section class="section1" style="margin: 0;box-shadow: 0 2px 10px">
<div class="container">
<a href="<?php echo get_post_permalink(); ?>">
<div class="img">
<?php the_post_thumbnail(); ?>
</div>
<h1 class="page-title"><?php the_title(); ?></h1>
</a>
<div class="clearfix"></div>
</div>
</section>
<!--end section 1-->
<?php the_content(); ?>
<?php
}
}
?>
<?php get_footer() ?>
my search.php page
<?php get_header(); ?>
<?php
if (have_posts()){
while (have_posts()) {
the_post();
?>
<section class="section1" rule="main">
<div class="container">
<div class="img">
<?php the_post_thumbnail(); ?>
</div>
<h1 class="page-title"><?php the_title(); ?></h1>
<div class="clearfix"></div>
</div>
</section>
<?php
}
}
?>
<?php get_footer(); ?>
if you need more code please tell me