• Hi people,

    I′m trying to display the results of a serach in a new page.
    In every page you can access through the SIDEBAR to the SEARCH FORM.

    <form method="get" id="searchform" action="https://127.0.0.1/site/searchs/">
    <label class="hidden" for="s"></label>
    	<input type="text" value="<?php the_search_query(); ?>" name="s" id="caja" />
    	<input type="submit" id="boton" value="SEARCH" />
    </form>

    I created a new page with a blank template called searchs.php
    Also, I added to the pages and put some content.

    <?php
    /*
    Template Name: Searchs
    */
    ?>
    
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    
    <?php the_title(); ?>
    
    <?php endwhile; ?>
    
    <div class="navigationpost">
    <?php previous_posts_link('<span><img src="/img/img1.png" class="img1" alt="img1" /></span><span class="next-entries">Newer Entries</span>');
    ?>
    <?php next_posts_link('<span class="previous-entries">Older Entries</span><span><img src="/img/img2.png" class="img2" alt="img2" /></span>') ?>
    
    <?php else : ?>
    
    <div class="resultadosdiv">
    <span>Sorry: nothing found</span>
    <br /><br />
    
    <br /><br />
    We could not find contents related to your search.<br />
    Try changing the search criteria.<br />
    All searches are saved, so, we'll consider your inquire for future material.
    <br /><br />
    
    </div>
    
    <?php endif; ?>

    But when I try to GET the results using:
    https://127.0.0.1/site/searchs/?s=world (ex, world as key to search) it gives me 404 error.

    So… I can′t access to the results or the list of them.

    If I use that code in the INDEX page I don′t have problems, IT WORKS, but I want to show the results in this page.

    Also, I don′t have problems entering to the page: https://127.0.0.1/site/searchs/

    Anyone knows where can the problem be?

  • The topic ‘Display results in other page – Really stuck’ is closed to new replies.