Site logo

Archived topic

Search on specific page

5 replies · Started by Benny on July 21, 2020

Viewing posts 1–6 of 6

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?

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 ?

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.

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

You're welcome

This archived topic is closed to new replies.