StackExchangers!
I have searched the internet left right and center and still cannot find a way to alter the search results that are displayed. Basically I would like no posts and only child pages of this parent page to be displayed in the search results of my WP Site:
http://universitycompare.com/university-guide/
Otherwise, if none of these pages are displayed it would display null results.
Any help/direction is appreciated, I did try and gather as much information from here, forums and asking webdev friends – But I am completely stuck so I have resorted to asking StackExchange.
Hopefully this isn’t too broad and you understand what I have been trying to figure out for days, otherwise if not, please ask for what you need and I can provide.
Try the following approach.
Get the page using
get_page_by_path()
http://codex.wordpress.org/Function_Reference/get_page_by_path
The following snippet was taken from Codex page: Creating a search form
http://codex.wordpress.org/Creating_a_Search_Page
Search results are obtained using WP_Query instance.
You can use WP_Query codex page to learn more about available options.
https://codex.wordpress.org/Class_Reference/WP_Query