I want to include an automatic search results output on my 404 page based on the url that the user has type in.
The problem is that on the usual search.php file, wordpress gets the value from the URL parameter and uses the regular loop like so:
<?php while (have_posts()) : the_post(); ?>
<h1>Search Results</h1>
<a href="<?php the_permalink() ?>"> <h2><?php the_title(); ?></h2> </a>
<?php endwhile; ?>
How do I get it so that I can manually enter the search term in the code?
Much appreciated.
You want to automatically search with the value from url?
maybe you can show your similiar post with that value, or show them a recent post with search form , using search for your site and google.com.
may be this link could help Built Effective 404 Error Pages
Hope this help,