WordPress How to display search results in search.php
Question
I am trying to display search results in search.php , but no results showing. it just show this
search results for: then the keyword I put in the search box only nothing more. so the actual results for the keyword not showing from the posts.
I have two files. here are
search.php
<?php get_header(); ?>
<h5><b>SEARCH RESULTS</b></h5>
<h3 class="mt-30 mb-15">SEARCH RESULTS FOR YOUR KEYWORD</h3>
<h1><?php printf( __( 'Search Results for: %s'), '<span>' . get_search_query() . '</span>' ); ?></h1>
<?php get_footer(); ?>
and searchform.php
<form action="/" method="get">
<label for="search">Search in <?php echo home_url( '/' ); ?></label>
<input type="text" name="s" id="search" value="<?php the_search_query(); ?>" />
</form>
so what should I do?
0
php
3 years
2020-06-01T13:10:37-05:00
2020-06-01T13:10:37-05:00 0 Answers
85 views
0
Leave an answer