Support » Installing WordPress » Changing domain loose all the images.

  • Resolved kadorrna


    Hi to everyone, I have change the domain and everything seems to works fine but the images in the database in the guid field still have the old domain, if I look the link in the admin panel the link seems ok, but in the database is not ok.

    Can somebody give me a hint?

    I had tried but nothing changed. The images still are not shown.

    Thanks in advance.

Viewing 1 replies (of 1 total)
  • I have solved bringing the image in other way (better maybe)

    function getPostImageByTitle($postid, $imageName,$orderBy="DESC"){
    	global $wpdb;
    	$querystr = "SELECT ".$wpdb->posts.".* FROM ".$wpdb->posts." WHERE ".$wpdb->posts.".post_parent = ".$postid.
    	    " AND ".$wpdb->posts.".post_type = 'attachment'
    	    AND (".$wpdb->posts.".post_mime_type = 'image/png'
    	    		OR ".$wpdb->posts.".post_mime_type = 'image/gif' OR ".$wpdb->posts.".post_mime_type = 'image/jpeg')
    	    AND ".$wpdb->posts.".post_status = 'inherit'
    	    AND ".$wpdb->posts.".post_title = '".$imageName."'
    	    ORDER BY $wpdb->posts.post_date ".$orderBy;
    	$image = $wpdb->get_results($querystr, OBJECT);
    	if (sizeof($image) == 1){
    			//return $image[0]->guid;
    		if ($imageName == "post"){
    			echo "<img src='".get_bloginfo('template_url')."/images/homeGeneric.png' />";
    		}elseif ($imageName == "icon"){
    			echo "<img src='".get_bloginfo('template_url')."/images/notfound.png' />";

    Before I was returning the guid now I am using the_attachment_link function.


Viewing 1 replies (of 1 total)
  • The topic ‘Changing domain loose all the images.’ is closed to new replies.