Forums › Forums › Search & Filter Pro › Show Media Library Images as a search result
Tagged: Media Library
- This topic has 3 replies, 2 voices, and was last updated 6 years, 11 months ago by Trevor.
-
Anonymous(Private) November 23, 2017 at 12:52 am #143380
Hello!
Great plugin so far!
How does one show Thumbnails/images as a search result. I am trying to pull images from my media library but it only displays titles and categories. I would like to accompany thumbnails as well. If there is a shortcode for this, that would be super great.
Thank you for your help.
Best
MasatoAnonymous(Private) November 23, 2017 at 7:43 am #143416Here is the screenshot back: I chose Media as the type of post
http://malikianphotography.com/wp-content/uploads/2017/11/Screen-Shot-2017-11-22-at-11.40.14-PM.png
Here is the link of the page. It is showing the titles and the categories but not the actual images.
http://malikianphotography.com/index/
Thanks
MasatoTrevor(Private) November 23, 2017 at 8:56 am #143424It will require some coding skills, but it is not hard. You first need to read this page in our documentation.
You can change the HTML, the style tags, delete stuff, add stuff in the copy of the results.php file.
I think this is the code you need (I am not sure though):
<?php echo wp_get_attachment_image( get_the_ID(), "thumb", "", "" );?>
This is from some code I wrote I while ago, here is a sub sample of the whole thing:
while ($query->have_posts()) { $query->the_post(); $gallery_link_url = get_post_meta( attachment_url_to_postid(wp_get_attachment_image_url( get_the_ID(), "full", false )), $key = '_gallery_link_url', $single = true); if ($gallery_link_url == "") $gallery_link_url = "#"; ?> <div> <h2><a href="<?php echo $gallery_link_url; ?>" target="_blank"><?php the_title(); ?></a></h2> <a href="<?php echo $gallery_link_url; ?>" target="_blank"> <?php echo '<span class="responsive">'; echo wp_get_attachment_image( get_the_ID(), "thumb", "", "" ); echo '</span>'; ?> </a> </div>
-
AuthorPosts