• zaidapicazo

    (@zaidapicazogmailcom)


    Hello,

    I’ve got a search post by custom post type and I need to show the result posts in the same page instead in archive page. This is my code:

    <form role="search" action="'. site_url('/') .'" method="get" id="searchform"><input class="introducir-termino-busqueda" type="text" name="s" placeholder="'. __('Search ...','cleanstart-child').'"/><input type="hidden" name="post_type" value="recurso" /><input class="buscar" type="submit" alt="Search" value="" /></form>

    Could someone help me?

    Thank you very much in advance

    Zaida

Viewing 1 replies (of 1 total)
  • Thread Starter zaidapicazo

    (@zaidapicazogmailcom)

    Hello again, noone know how I could show search results in a normal page, not archive or search page? How could I get search results? I’ve got a page template with some filters which show results in the same page and I would need to achieve search results in that page too.

    I tried to change action to my page:

    $buscador = '<form role="search" action="'. site_url('/') .'" method="get" id="searchform"><input class="introducir-termino-busqueda" type="text" name="s" placeholder="'. __('Search ...','cleanstart-child').'"/><input type="hidden" name="post_type" value="recurso" /><input class="buscar" type="submit" alt="Search" value="" /></form>';

    to

    $buscador = '<form role="search" action="'. site_url('/es/recursos/') .'" method="get" id="searchform"><input class="introducir-termino-busqueda" type="text" name="s" placeholder="'. __('Search ...','cleanstart-child').'"/><input type="hidden" name="post_type" value="recurso" /><input class="buscar" type="submit" alt="Search" value="" /></form>';

    But it says 404 page not found in that case.

    Hope someone can help me.

    Thank you!

Viewing 1 replies (of 1 total)
  • The topic ‘search result in the same page’ is closed to new replies.