Error on Search results
-
When I do a search, redirects to the home page and not showing the results but the search term is in the url bar.
I call the search form from the header.php with the function:
get_search_form( true );and the search results page (search.php) have:
<?php $s = get_search_query(); $args = array( 's' =>$s ); // The Query $the_query = new WP_Query( $args ); if ( $the_query->have_posts() ) { _e("<h1>Resultados de busqueda para: <u>".get_query_var('s')."</u></h1>"); while ( $the_query->have_posts() ) { $the_query->the_post(); ?> <li> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> </li> <?php } }else{ ?> <h1>No hay coincidencias</h1> <div class="alert alert-info"> <p>Por favor intenta nuevamente la busqueda con otro término.</p> </div> <?php } ?>The page I need help with: [log in to see the link]
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Error on Search results’ is closed to new replies.