I am currently learning and hacking away at twenty eleven, I was trying to figure out how to customise the 404 page to take the url data as a search value, so, if the user typed site.com/2011/12/random-blog-posv/ (see the typo at the end)
The twenty eleven 404 page comes with a search bar, I want to take ‘2011’, ’12’ and ‘random blog posv’ as arguments and show the search result
(by this it would be possible to type a blog post and get it as the first result on the 404 page).
What I need to know:
– How to get the url string (I assume I’ll have to break it apart myself or is there a function for that..?
– how to display the results of that search on the 404 page (I assume I’ll take most from search.php but replace $s with $url or some other var)
Thanks in advance for any advice.
- The topic ‘getting the user imput for 404 search – beginner’ is closed to new replies.