{"id":6424,"date":"2009-10-15T14:53:37","date_gmt":"2009-10-15T14:53:37","guid":{"rendered":"https:\/\/www.amitbhawani.com\/blog\/?p=6424"},"modified":"2009-10-15T14:53:37","modified_gmt":"2009-10-15T14:53:37","slug":"how-to-show-images-in-blog-search-results","status":"publish","type":"post","link":"https:\/\/www.amitbhawani.com\/blog\/how-to-show-images-in-blog-search-results\/","title":{"rendered":"How to Show Images in Blog Search Results"},"content":{"rendered":"<p>I have a <a href=\"http:\/\/www.amitbhawani.com\/pictures\">Pictures Blog<\/a> and i was wondering if there is a way to show just Images on the Blog Search Results Pages because that would be far more better than the Normal Blog Results where the Blog Post Title &#038; a Small Excerpt would be shown, and in this case just the title would be shown as there is no text in the post. This can give the blog readers a dull look because they would expect beautiful images to be shown on a Photo Blog.<\/p>\n<p><figure id=\"attachment_6427\" aria-describedby=\"caption-attachment-6427\" style=\"width: 150px\" class=\"wp-caption alignright\"><a href=\"https:\/\/www.amitbhawani.com\/blog\/show-category-icons-in-sidebar\/\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.amitbhawani.com\/blog\/wp-content\/uploads\/2009\/10\/wordpress-tips-tricks.jpg?resize=150%2C150\" alt=\"Wordpress Tips\" title=\"Wordpress Tips\" width=\"150\" height=\"150\" class=\"size-full wp-image-6427\" \/><\/a><figcaption id=\"caption-attachment-6427\" class=\"wp-caption-text\">Wordpress Tips<\/figcaption><\/figure>Now here is a solution for this using the <a href=\"http:\/\/wordpress.org\/extend\/plugins\/get-the-image\/\">Get the Image<\/a> WordPress Plugin, which would display Images where ever specified. You need to Install and activate the plugin and then move over to the theme files because you need to make some changes in the Search Results page. This is normally the &#8216;search.php&#8217; file.<\/p>\n<p><strong>How does it pull images?<\/strong><br \/>\n1.  Looks for an image by custom field (one of your choosing).<br \/>\n2. If no image is found, it grabs an image attached to your post.<br \/>\n3. If no image is attached, it can extract an image from your post content (off by default).<br \/>\n4. If no image is found at this point, it will default to an image you set (not set by default).<\/p>\n<p><strong>How to use the plugin?<\/strong><br \/>\nFirst, you should know that there are two types of ways to call the image script, either with function-style parameters or query-string-style parameters. I prefer the former over the latter because it simply works better and is the way I&#8217;ll be explaining throughout this guide.<\/p>\n<p><strong>Example with function-style parameters<\/strong><br \/>\n<code>&lt;?php get_the_image( array( &#39;custom_key&#39; =&gt; array( &#39;Thumbnail&#39;, &#39;thumbnail&#39; ), &#39;default_size&#39; =&gt; &#39;thumbnail&#39; ) ); ?&gt;<\/code><\/p>\n<p><strong>Example with query-string-style parameters<\/strong><br \/>\n<code>&lt;?php get_the_image( &#39;custom_key=Thumbnail,thumbnail&amp;default_size=thumbnail&#39; ); ?&gt;<\/code><\/p>\n<p>The image script parameters<\/p>\n<p>By simply making a function call to &lt;?php get_the_image(); ?&gt; within a template file, the script will default to this:<br \/>\n<code>$defaults = array(<br \/>\n\t&#39;custom_key&#39; =&gt; array( &#39;Thumbnail&#39;, &#39;thumbnail&#39; ),<br \/>\n\t&#39;attachment&#39; =&gt; true,<br \/>\n\t&#39;default_size&#39; =&gt; &#39;thumbnail&#39;,<br \/>\n\t&#39;default_image&#39; =&gt; false,<br \/>\n\t&#39;order_of_image&#39; =&gt; 1,<br \/>\n\t&#39;link_to_post&#39; =&gt; true,<br \/>\n\t&#39;image_class&#39; =&gt; false,<br \/>\n\t&#39;image_scan&#39; =&gt; false,<br \/>\n\t&#39;width&#39; =&gt; false,<br \/>\n\t&#39;height&#39; =&gt; false,<br \/>\n\t&#39;echo&#39; =&gt; true<br \/>\n);<\/code><\/p>\n<p>This plugin works best if you use the Custom Image option in wordpress to add your Images and it would be great if it would support grabbing the First Images from the Blog Posts on the Search Result Pages or Category Pages.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have a Pictures Blog and i was wondering if there is a way to show just Images on the Blog Search Results Pages because that would be far more better than the Normal Blog Results where the Blog Post Title &#038; a Small Excerpt would be shown, and in this case just the title [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":19452,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[376],"tags":[],"class_list":{"0":"post-6424","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-wordpress","8":"entry"},"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.amitbhawani.com\/blog\/wp-content\/uploads\/2010\/12\/wordpress-tips-tricks.jpg?fit=300%2C300&ssl=1","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":1856,"url":"https:\/\/www.amitbhawani.com\/blog\/google-images-search-news-faces-photo-content\/","url_meta":{"origin":6424,"position":0},"title":"Google Images Search for News Faces &#038; Photo Content","author":"Amit Bhawani","date":"October 23, 2008","format":false,"excerpt":"Do you get confused while searching for specific images on Google Images? First of all lets accept the fact that Google Images is the best images search engine because you have a super large database of images for any keyword which is generally hard to find, lets exclude the stock\u2026","rel":"","context":"In &quot;Google&quot;","block_context":{"text":"Google","link":"https:\/\/www.amitbhawani.com\/blog\/category\/google\/"},"img":{"alt_text":"Google Images Logo","src":"https:\/\/i0.wp.com\/www.amitbhawani.com\/blog\/Images\/G\/Google-Images-Logo.JPG?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":10623,"url":"https:\/\/www.amitbhawani.com\/blog\/download-multiple-images-from-flickr-high-quality-pictures\/","url_meta":{"origin":6424,"position":1},"title":"Download Multiple Images from Flickr &#8211; High Quality Pictures","author":"Amit Bhawani","date":"April 28, 2010","format":false,"excerpt":"Am looking to download around 380 Original High Quality Photos from one of my friends Flickr account which were snapped on our recent holiday but it seems like there is no direct option for this. I have been clicking on each of the photos and then clicking on the option\u2026","rel":"","context":"In &quot;Web Tools&quot;","block_context":{"text":"Web Tools","link":"https:\/\/www.amitbhawani.com\/blog\/category\/web-tools\/"},"img":{"alt_text":"Bulk Download Flickr Photos","src":"https:\/\/i0.wp.com\/www.amitbhawani.com\/blog\/wp-content\/uploads\/2010\/04\/Bulk-Download-Flickr-Photos-1-300x242.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":9409,"url":"https:\/\/www.amitbhawani.com\/blog\/align-images-rss-feeds\/","url_meta":{"origin":6424,"position":2},"title":"Align Images in Feedburner Emails &#038; Rss Feeds","author":"Amit Bhawani","date":"March 26, 2010","format":false,"excerpt":"We have been looking out for a wordpress plugin which can fix the Images display in the Feedburner emails we sent, because in most cases the Images look broken, by displaying between the paragraphs and not correctly listing in the left or right aligned location. Here is a excellent wordpress\u2026","rel":"","context":"In &quot;Wordpress Guide&quot;","block_context":{"text":"Wordpress Guide","link":"https:\/\/www.amitbhawani.com\/blog\/category\/wordpress\/"},"img":{"alt_text":"Fix Image Alignment Feeds","src":"https:\/\/i0.wp.com\/www.amitbhawani.com\/blog\/wp-content\/uploads\/2010\/03\/Fix-Image-Alignment-Feeds-300x144.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":8865,"url":"https:\/\/www.amitbhawani.com\/blog\/how-to-add-twitter-search-box\/","url_meta":{"origin":6424,"position":3},"title":"How to Add a Twitter Search Box on Blog or Website","author":"Amit Bhawani","date":"March 1, 2010","format":false,"excerpt":"We have previously covered a similar article on adding Google Images Search Box on your blog, and this time we are going to add a Twitter Search Box which seems to be quite better when you have got social media fans. In this case there are two options, ie either\u2026","rel":"","context":"In &quot;Twitter Blog&quot;","block_context":{"text":"Twitter Blog","link":"https:\/\/www.amitbhawani.com\/blog\/category\/twitter-blog\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":8373,"url":"https:\/\/www.amitbhawani.com\/blog\/seo-for-images\/","url_meta":{"origin":6424,"position":4},"title":"SEO For Images Tips to Rank in the Top","author":"Amit Bhawani","date":"February 6, 2010","format":false,"excerpt":"Google is the Biggest Referrer to my Blog and its divided into two sections ie from Normal Search Results & Google Images Search. Its very essential for every website owner to make sure that the Images they add on their websites & blogs are optimized for the Search Engines which\u2026","rel":"","context":"In &quot;SEO Blog&quot;","block_context":{"text":"SEO Blog","link":"https:\/\/www.amitbhawani.com\/blog\/category\/seo-tips\/"},"img":{"alt_text":"google images search","src":"https:\/\/i0.wp.com\/www.amitbhawani.com\/blog\/wp-content\/uploads\/2010\/02\/google-images-search.gif?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":5095,"url":"https:\/\/www.amitbhawani.com\/blog\/advanced-image-search-engine\/","url_meta":{"origin":6424,"position":5},"title":"Advanced Image Search Engine","author":"Amit Bhawani","date":"July 27, 2009","format":false,"excerpt":"Mage search works out to be faster and painless in xcavator.net. Its search technology helps to search photos is a much easier, intuitive and more precisely. Xcavator.net is photo search portal that has been designed exclusively for the creative people. You have facility to quickly scan through millions of images,\u2026","rel":"","context":"In &quot;Tips &amp; Tweaks&quot;","block_context":{"text":"Tips &amp; Tweaks","link":"https:\/\/www.amitbhawani.com\/blog\/category\/tips-tweaks\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.amitbhawani.com\/blog\/wp-json\/wp\/v2\/posts\/6424","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.amitbhawani.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.amitbhawani.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.amitbhawani.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.amitbhawani.com\/blog\/wp-json\/wp\/v2\/comments?post=6424"}],"version-history":[{"count":0,"href":"https:\/\/www.amitbhawani.com\/blog\/wp-json\/wp\/v2\/posts\/6424\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.amitbhawani.com\/blog\/wp-json\/wp\/v2\/media\/19452"}],"wp:attachment":[{"href":"https:\/\/www.amitbhawani.com\/blog\/wp-json\/wp\/v2\/media?parent=6424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.amitbhawani.com\/blog\/wp-json\/wp\/v2\/categories?post=6424"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.amitbhawani.com\/blog\/wp-json\/wp\/v2\/tags?post=6424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}