-
AuthorPosts
-
October 21, 2016 at 4:30 pm #702512
Hi
I have checked the forum for this and the one answer I found didn’t work for me.
I want to display search results as a grid in a similar style to Portfolio grid. Preferably with thumbnail, title and excerpt.
Can you help?
The site is at http://www.dominicrutterford.co.uk/the-collection/
October 24, 2016 at 8:25 pm #703421Hey domchocolate,
Please refer to this post – https://kriesi.at/support/topic/grid-style-search-results-with-sidebar/
Please feel free to request – or vote if already requested – such feature on Enfold feature request form.
Best regards,
YigitOctober 24, 2016 at 10:57 pm #703469OK I have it working but is there a way of making it use the Portfolio grid layout, 4 columns, image width set to automatic? So that it looks like this:- http://www.dominicrutterford.co.uk/the-collection/ rather than http://www.dominicrutterford.co.uk/?s=Dinar??
Thanks in advance
Dominic
October 25, 2016 at 2:07 pm #703780Hi,
Please edit your code and find following line
'columns' => 4,
and change it to
'columns' => 5,
Best regards,
YigitOctober 25, 2016 at 8:21 pm #703947Hi
That changes the columns to 5 which is fine but it does not display the results the same as http://www.dominicrutterford.co.uk/the-collection/.
http://www.dominicrutterford.co.uk/the-collection/ displays as a portfolio grid, 5 columns with image size set to automatic.
The search results are displaying with the images much smaller and the spaces between much wider.
How can I do this in search results?
Here is my code:
<?php if(!empty($_GET['s'])) { echo "<h4 class='extra-mini-title widgettitle'>{$results}</h4>"; global $posts; $post_ids = array(); foreach($posts as $post) $post_ids[] = $post->ID; $atts = array( 'type' => 'grid', 'items' => get_option('posts_per_page'), 'columns' => 5, 'class' => 'avia-builder-el-no-sibling', 'paginate' => 'yes', 'use_main_query_pagination' => 'yes', 'thumbnail' => 'portfolio', 'custom_query' => array( 'post__in'=>$post_ids, 'post_type'=>get_post_types() ) ); $blog = new avia_post_slider($atts); $blog->query_entries(); echo "<div class='entry-content'>".$blog->html()."</div>"; } ?>
Best
Dominic
October 25, 2016 at 8:23 pm #703949PS search result can be found at http://www.dominicrutterford.co.uk/?s=Dinar
October 25, 2016 at 9:43 pm #703986Hey!
Please try adding following code to Quick CSS in Enfold theme options under General Sttyling tab
.template-search .post-entry { margin-left: 1%; width: 19%; } .template-search .post-entry .first { margin-left: 0; }
Cheers!
YigitOctober 25, 2016 at 10:07 pm #704009Hi Yigit
I’m afraid that didn’t do anything to the page at all – page didn’t change at all. Even when I added !important:
.template-search .post-entry { margin-left: 1%!important; width: 19%!important; } .template-search .post-entry .first { margin-left: 0!important; }
I wonder whether it’s more to do with the image thumbnail size that’s being called and/or styled?
Any thoughts or other ideas?
D
October 25, 2016 at 10:15 pm #704011BTW that CSS is being recognised when I check in Firebug. And if I use Firebug to force the images to be larger in the HTML it seems to correct the layout (although the images are pixelated because I am enlarging a portfolio-small image). I think we just need to find a way of calling the larger images and making them automatic.
I did also try:
'columns' => 'automatic',
This called the right images but broke the grid layout so that they were all stacked on top of each other in one long column.
Dominic
October 25, 2016 at 10:15 pm #704012Hi!
They show up fine on my end, attached a screenshot in private content field.
Please flush browser cache and refresh your page a few times – http://wiki.scratch.mit.edu/wiki/Hard_Refresh
Best regards,
YigitOctober 25, 2016 at 10:26 pm #704017Yes they show up but they are not working like http://www.dominicrutterford.co.uk/the-collection/.
On http://www.dominicrutterford.co.uk/the-collection/ the margins stay the same fixed width and the images scale depending on screen width.
On the latest http://www.dominicrutterford.co.uk/?s=Dinar the margins scale depending on screen width and the images stay the same.
Please see screenshots:
October 25, 2016 at 10:35 pm #704024I can do this in Firebug but it needs to call the larger image and not the small one. I just forced the image to 500px and gave it a max-width. See code in screenshot.
October 25, 2016 at 10:41 pm #704028I think I’ve cracked it!
.slide-image img { width: 100vw; }
Do you see any issues with that?
- This reply was modified 8 years, 1 month ago by domchocolate.
October 25, 2016 at 10:44 pm #704030I spoke too soon. That code is working but the image being called is still too low-resolution. I need to be able to call a larger one.
Dominic
October 25, 2016 at 10:51 pm #704034Hey!
Please add following code to Quick CSS in Enfold theme options under General Styling tab
.search-results .container { padding: 0 10px; }
Regards,
YigitOctober 25, 2016 at 10:57 pm #704037Have done – thanks. Although this doesn’t help my too low-res thumbnails/images being called.
See attached and view at 100% (it’s less noticeable on smaller res screens such as laptops)
D
October 25, 2016 at 10:59 pm #704038Difference between the two is http://www.dominicrutterford.co.uk/the-collection/ calls
<img class="attachment-medium size-medium wp-post-image"
and search results calls
<img class="attachment-portfolio_small size-portfolio_small wp-post-image"
October 25, 2016 at 10:59 pm #704039Hi,
Try the following:
1. Install this plugin: https://wordpress.org/plugins/simple-image-sizes/
2. Go to Settings > Media
3. Change theportfolio_small
image size (increase its width / height).
4. Regenerate the thumbnails by clicking the button at the bottom.Best regards,
YigitOctober 25, 2016 at 11:12 pm #704046Brilliant – we’re there. Thanks for all of your help!
October 25, 2016 at 11:29 pm #704052Hey!
You are welcome!
For your information, you can take a look at Enfold documentation here – http://kriesi.at/documentation/enfold/
And if there are features that you wish Enfold had, you can request them and vote the requested ones here – https://kriesi.at/support/enfold-feature-requests/
For any other questions or issues, feel free to post them here on the forum and we will gladly try to help you :)Best regards,
Yigit -
AuthorPosts
- The topic ‘I want to display my search results in a grid’ is closed to new replies.