search.php template (search results display?)

Hello,

I am hoping to see my search results in a grid, or perhaps at least 2 columns instead of one column. I noticed a search.php file in the theme folder so I thought I would ask here before doing any editing.

Also, if you do a search using the drop downs, you can see that the images are showing in full size in each result. Can I also make these images to scale with the result so they are not cut off?

Thanks,
Robert

Oh and to add, there is no padding between results. So since I have a shopping website, it makes it confusing to look at the results because you can’t tell right away which description goes to which picture. So I was hoping to add padding between results as well.

Thanks!!

This has nothing to do with theme itself because by default search results should look like this:

https://colorlib.com/travelify/?s=test

There are loads of custom implementation for your website, so I can’t help you with that.

Sorry about that.

Would you accept payment to help me??

Hello Aigars,

Can you please explain how this does not relate to the theme? I have searched the internet far and wide and I can not find help with fixing these problems. Can you maybe tell me what I need to edit to change it myself? I have messed with search.php in the theme folder and it does not change anything. So I think it is using some other file?

My search form is from Taxonomy Picker Plug-In, could this be where the code is hiding?

I really appreciate your knowledge and previous help. If you can, I would like to pay you to help me with this and a few things. Please let me know.

Thanks!

Search is part of theme but your customization have broken down theme functionality and layout, therefore I can’t help you with that.

Search.php is only a placeholder where functions are being echoed and the main magic happens in search loop which you can find in content-extensions.php which is located in theme folder - library - structure.

You can try to bring back styling by adding some paddings, margins etc. Just look into original theme files and try to find what is missing.

Definitely the one thing to start with is to add margin between search results.

section.product {
    margin-bottom: 20px;
} 

Currently I am unavailable for freelance work due to heavy workload on my 9to5 job and several online project. Sorry about that.

Thank you very much Aigars! I appreciate it. This helped a lot! I did not know to look in content-extensions.php, so now I have a good direction. Your margin code worked great - the results looks much better now.

No worries, I am glad to hear you’re busy! If you ever want some work let me know, this site is a long time coming. :slight_smile:

I have added to your code, and now it looks just how I need except for the image size!

section.product {
    margin-bottom: 20px;
    margin-left: 10px;
    margin-right: 10px;
    width: 295px;
    min-height: 420px;
    float: left;
} 

This made everything display in a grid view! Is it possible that the image size can be scaled within this same code?

Images are cropped to 670x300 px as defined in functions.php file. You can try to adjust image height to something like 9999 and then regenerate thumbnails. it should keep the original aspect ratio.

Other options would be to change featured image size to 670 by 670 so you will get square images.

This will take effect on regular blog page, so make sure that this is what you are looking for.

Other thing is that you will have to regenerate thumbnails and there is plugin for that since WordPress won’t do it automatically.