[Plugin: Auto Featured Image] Fix for non images issue
-
I have been using this for a while, and it worked fine. Until I upgraded to WP 3.2.1, and started doing development locally.
I have spend a couple hours trying to figure out why this is not working, and here is the reason:
If the links in the post do not have the full url (ie: https://..) in the front, then the plugin does all the processing, but does not validate the url, so it does not insert it. This is why it says “processing…”, but no image insert.
So here is the fix:
at about line 77, you will see:
$image_url = self::found_image_url($post->post_content); // if no url found, do nothing if( $image_url == null ) return;
Change this so it looks like:
$image_url = self::found_image_url($post->post_content); // Add condition where WordPress blog is in a subdirectory or in localhost, and image in post does not have full link // get_bloginfo('wpurl') gets site homepage with subdirectory (if there is one) if ((strpos($image_url, "https://") == false) && (strpos($image_url, "https://") == false)) $image_url = get_bloginfo('wpurl') . "/" . $image_url; // if no url found, do nothing if( $image_url == null ) return;
This will also fix the localhost problem.
- The topic ‘[Plugin: Auto Featured Image] Fix for non images issue’ is closed to new replies.