Jump to content
Sign in to follow this  
piarulli

search page result

Recommended Posts

piarulli

Hi, I have created a secondary search form with many fields. I want to know how to create a separate search result page (other than standard) to display search result *without* impact on the standard search. Thanks

Share this post


Link to post
Share on other sites
cmunns

The secondary search bar...is this a plugin? Do they have template tags that you can use?

Share this post


Link to post
Share on other sites
piarulli

It is a plugin developed by me. Said differently, when you submit the standard search form, it use the 'template.postloop.php' for the results. I want that my new search form use a 'template.my_search.php' for the results. How can I do? Thanks

Share this post


Link to post
Share on other sites
bryan-hadaway

Basically, make a new page "Search" or whatever you want... and set the template you want for it. Set your new search for `post=""` to go to that page. Then you need to set the code to catch the search term of course. Should be able to copy and modify from index.php. Anyways, let me mark for further developer review to make sure this is the right track. Thanks, Bryan

Share this post


Link to post
Share on other sites
cmunns

Okay easy enough. I think I would actually just open up searchform.php and add a conditional in that template to use different search parameters. Then in the template.postloop.php down here: `

<?php if(is_search()):?>

<?php _e('No results for ', 'pagelines');?>"<?php the_search_query();?>"

<?php _e('Try another search?', 'pagelines');?>

<?php else:?>

<?php _e('Nothing Found','pagelines');?>

<?php _e('Sorry, what you are looking for isn't here.', 'pagelines');?>

<?php endif;?>
<?php get_search_form(); ?>
` You'd also want to write another conditional for displaying the results from this new search form.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×