Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Is it possible in wordpress to customise the search page to show certain information depending on the result?

For example I run a motorsport site and if I searched for Jenson Button it would return a page with all the posts mentioning Jenson Button ( http://www.thecheckeredflag.co.uk/?s=Jenson+Button ).

Is it possible to customise this page to show a div at the top with relevant links about that Jenson Button or whatever driver/search term the user is looking for?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You can create a template file in your theme that is used to display search results. It is called search.php. If it does not exist the index.php file is displayed.

At the top of that file, or wherever you want, you can place extra code that queries your special posts (depending on how you saved driver data). You can get the current search query by calling get_query_var( 's' ).

share|improve this answer
    
I'll give it a go... thanks! –  Vince Pettit Jan 21 '11 at 11:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.