WordPress.org

Ready to get started?Download WordPress

Forums

Generate Post Thumbnails
Images with relative URLs (1 post)

  1. Abdussamad Abdurrazzaq
    Member
    Posted 3 years ago #

    Hello

    I recently switched my site from serendipity CMS to wordpress. As a result the images in my blog posts carry the serendipity uploads directory path:

    <img src='/uploads/whatever.serendipity.thumb.jpg'>

    Because the path is

    a: Not wordpress uploads directory
    b: Relative path

    Generate post thumbnails tries to download as if they are complete URLs when in reality they are not. So this change above line number 190 ($saved_in_wordpress = false;):

    if(strpos( $image, 'http:' ) !== 0) {
    			$image=site_url().'/'.$image;
    		}

    Fixes the problem and images are successfully assigned as post thumbnails.

    Regards,
    Abdussamad

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

  • RSS feed for this topic
  • Started 3 years ago by Abdussamad Abdurrazzaq
  • This topic is not a support question
  • WordPress version: 3.1.1