I’ve been trying for hours if not a day to try and get my custom search.php and searchform.php to work and still no success. I’ve read a lot on these two templates and still no success.
Here is my search.php:
<div class="post-wrap">
<?php if ( have_posts() ) : while (have_posts()) : the_post(); ?>
<?php the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>
<?php the_excerpt(); ?>
<?php endwhile; else: ?>
<p>Woops There is no post yet</p>
<?php endif; ?>
</div><!-- /.social-media-posts -->
Here is my searchform.php:
<form action="<?php echo home_url( '/' ); ?>" id="searchform" class="search-form" method="get" role="search">
<input type="text" id="s" placeholder="Search" class="search-field">
<input type="submit" value="" id="searchsubmit" class="search-submit">
<a class="search-close" href="#"><i class="fa fa-times-circle"></i></a>
</form>
And finally, this is what I use to call my searchform.php in my navigation template:
<?php get_searchform(); ?>
Still nothing works, i’m getting a little discouraged. I would appreciate any help. Thanks!