I created a view with custom sized images. All is well on my staging server, but when I install the same archive locally the images disappear. Dafault image size still works though.
Any ideas?
Hi, it's hard for me to say but there are a few possibilities:
- Your staging server was HTTPS and your local test environment is HTTP, but the migration script you used to migrate the site didn't change all the URLs correctly. Now a mixed-content error is preventing load HTTPS images over HTTP.
- Your migration script didn't copy all the images correctly from the staging server into your local environment.
- There is a localhost configuration issue preventing WordPress's image processing system from creating resized images.
Open the browser console and check for any error messages. Copy + paste those here for me to review. Tell me more about how you migrated from the staging site to your local environment. Did you run a custom database script? Did you use a 3rd-party migration tool like Duplicator or All-in-One WP Migration?
First I created an archive through cPanel.
Then I used DesktopServer with SSL locally enabled to import the archive. Apart from this specific problem the site runs well.
This the error message I get in the console: see attachment
First I created an archive through cPanel. Then I used DesktopServer with SSL locally enabled to import the archive.
Okay I'm not familiar with DesktopServer's import process so I don't have any specific advice there. I don't see any 404 errors about missing images in the screenshot you provided. One missing development javascript file, but nothing to be concerned about. When you inspect the page source, are the image tags included in the page content at all? If so, and no 404 errors are shown in the console related to these images, then there is most likely a problem with CSS or JavaScript.
Are you able to turn on server logs on your local environment? If you're not familiar with logs, I can show you how to turn them on temporarily. Go in your wp-config.php file and look for
define('WP_DEBUG', false);
Change it to:
define('WP_DEBUG', true);
Then add these lines, just before it says 'stop editing here':
ini_set('log_errors',TRUE);
ini_set('error_reporting', E_ALL);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');
Then reload the page where images are missing. If any backend errors are generated, this will create an error_log.txt file in your site's root directory. Please send me its contents. Once that is done, you can revert the changes you made to wp-config.php.
I edited wp-config but for some reason the error log file is not generated.
Image tags are not included in the code.
This is the piece of code:
<div class="main-list">
[wpv-post-featured-image size="custom" width="65" height="65" class="alignleft" crop="true"]<h4>[wpv-post-link]</h4>
</div>
When I change this to
<div class="main-list">
[wpv-post-featured-image]<h4>[wpv-post-link]</h4>
</div>
the images appear as expected.
Strange.
Try adding some invalid PHP in your theme's functions.php file to generate a fatal error, then check to see if an error_log.txt file is generated. If so, then you know the wp-config.php settings are correct but there are simply no errors generated by the shortcode. If no log file is generated, then there's a problem with logging, you'll need to investigate that on your local environment. It may be that your localhost or MAMP is automatically logging somewhere else, or has disabled all logging, etc.
Try a different built-in size, like size="thumbnail", and remove the height and width attributes. Is the standard thumbnail-sized image shown? If not, there could be a problem with the image manipulation PHP extensions on your server, or the resized image directory cannot be written to for some reason like file permissions.
I suppose it could also be a memory issue, you may want to confirm you've got at least 128M and preferably 256M available to WordPress. Normally that would generate a log message though.