Title: it won&#039;t pick 1st image unless it&#039;s https
Last modified: August 21, 2016

---

# it won't pick 1st image unless it's https

 *  Resolved [Doug](https://wordpress.org/support/users/nicoblog/)
 * (@nicoblog)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/it-wont-pick-1st-image-unless-its-https/)
 * I have the plugin setup to show the first image of each post.
    The problem is
   this, it won’t pick the image unless i’m using https on the url. Example:
 * This doesn’t show up at all:
    [http://farm8.staticflickr.com/7389/12570757443_74d4d68fc2_o.jpg](http://farm8.staticflickr.com/7389/12570757443_74d4d68fc2_o.jpg)
 * This does:
    [https://farm8.staticflickr.com/7389/12570757443_74d4d68fc2_o.jpg](https://farm8.staticflickr.com/7389/12570757443_74d4d68fc2_o.jpg)
 * I’m not using timthumb just picking first image of the post and showing as it
   is, so there must be something on the plugin code stopping the first link to 
   shop up and allowing the second one.
 * I need it to work for NON HTTPS links as well.
 * Thanks!
 * [https://wordpress.org/plugins/top-10/](https://wordpress.org/plugins/top-10/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/it-wont-pick-1st-image-unless-its-https/#post-4619163)
 * Can you post your blog url / post url? Is your site on an https as well?
 * Can you delete lines 1011 and 1013 in top-10.php file?
 * i.e. these two lines
 *     ```
       if (((strpos($matches[1][0], parse_url(get_option('home'),PHP_URL_HOST)) !== false) && (strpos($matches[1][0], 'http://') !== false))|| ((strpos($matches[1][0], 'http://') === false))) {
       ```
   
 * and
 *     ```
       }
       ```
   
 * Do not delete 1012, i.e.
 *     ```
       $postimage = preg_replace('/\?.*/', '', $matches[1][0]); // we need the first one only!
       ```
   
 *  Thread Starter [Doug](https://wordpress.org/support/users/nicoblog/)
 * (@nicoblog)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/it-wont-pick-1st-image-unless-its-https/#post-4619166)
 * Hi! That seem to have solved the problem.
    I use all kind of external image hostings
   like google drive, piacasa/g+ albums, flickr, imageshack, etc.
 * And i had this problem it would only pick up the first image if it was hosted
   on google drive/picasa/g+ and no other image hosting.
 * With that change it now accepts all hostings, which is amazing cos i’m not forced
   to use google anymore (it has a monthly bandwidth limit).
 * Thanks a lot!
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/it-wont-pick-1st-image-unless-its-https/#post-4619182)
 * Thanks for confirming. I’m going to remove those two lines in the next version.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘it won't pick 1st image unless it's https’ is closed to new replies.

 * ![](https://ps.w.org/top-10/assets/icon-256x256.png?rev=2986432)
 * [WebberZone Top 10 — Popular Posts](https://wordpress.org/plugins/top-10/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/top-10/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/top-10/)
 * [Active Topics](https://wordpress.org/support/plugin/top-10/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/top-10/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/top-10/reviews/)

## Tags

 * [problem](https://wordpress.org/support/topic-tag/problem/)
 * [thumbnail](https://wordpress.org/support/topic-tag/thumbnail/)
 * [top10](https://wordpress.org/support/topic-tag/top10/)

 * 3 replies
 * 2 participants
 * Last reply from: [Ajay](https://wordpress.org/support/users/ajay/)
 * Last activity: [12 years, 3 months ago](https://wordpress.org/support/topic/it-wont-pick-1st-image-unless-its-https/#post-4619182)
 * Status: resolved