display user's recent posts in sidebar not working on search page
If a user is logged in I would like to display a list of their recent posts in the sidebar. I have coded it and it works on all pages except for the search results page. On that page it seems it takes whatever search param is passed in the url and applies it to the custom query.
So for example I want to display a user's recent posts on a page with "/?s=mechanic". In the query to return that user's posts it filters it based on that search term.
Is there any way to nullify whatever is in the url as a search param?