[Resolved] Search on specific page

Home Forums Support [Resolved] Search on specific page

Home Forums Support Search on specific page

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1370641
    Benny

    Hey there, i wanted to include a Search Box with this Snippet

    add_shortcode( ‘search’, ‘tu_search_shortcode’ );
    function tu_search_shortcode() {
    ob_start();
    get_search_form();
    $ret = ob_get_contents();
    ob_end_clean();
    return $ret;
    }

    and make it search for things on one specific page. Is this even possible to search on one page only?

    #1370671
    David
    Staff
    Customer Support

    Hi there,

    can you explain a little more?

    1. Will the search form be on all pages ?
    2. What results do you want it to return ?

    #1370713
    Benny

    No, it should be a searchbox on one page for this same page. In the end i’m planning a searchable faq page with a search form whose results are only from this page.

    #1370724
    David
    Staff
    Customer Support

    All search plugins i am aware of only search the database.
    Most users would resort to CTRL + F or in page search on mobile browsers for this kind of function.

    But i found this JS which taps into the browser find:

    http://www.javascripter.net/faq/searchin.htm

    Or you could create your own search engine:

    https://programmablesearchengine.google.com/about/

    #1370735
    Benny

    Ok, thank you. I will have a look into it 🙂

    #1370745
    David
    Staff
    Customer Support

    You’re welcome

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.