While the images are now being displayed thanks to your code in mentioned support ticket. On this property, the wrong images are being loaded hidden link
I have reverted the code on the original site hidden link and there the correct images are being displayed.
The previous modification focused on ensuring that media IDs were correctly retrieved by matching filenames in the database without considering domain specifics. This was a simple change that aimed to fix an issue with the custom code getting the wrong site url when calling the Avada gallery shortcode.
Custom code like this can involve complex logic that might vary greatly between setups.
While I can point out where the logic might need more refinement, as I did in the last ticket, diving deeper into such code falls outside the scope of our standard support. I highly recommend consulting with one of our Toolset Certified Contractors who can assist with advanced customizations to your site's code and troubleshoot these nuanced issues more effectively:
I think I have found the solution. I had a look at the original code and saw '"SELECT ID FROM $wpdb->posts WHERE guid = %s",
$image'
I know that when duplicating a site, the GUID is not replaced and will always point to the original site.
I did a replace DB and first with your proposed code, it did not change anything, but then I reverted back to the original code and now the correct images load on both sites.
The confusion in the DB must come from equally names images on both sites but in different folders, and basename does not take path into account, so DOMAIN-A/01/15-1.jpg 'looks' the same as DOMAIN-B/05/15-1.jpg. And /01/15-1.jpg will be the first hit when browsing through the folders in the /uploads/ folder, but that property needed /05/15-1.jpg. I got triggered because on hidden link some images were correct (/05/ folder) but other images were taken from /01/. If it were a certain code error, either no images would load or all would be wrong, not a mix of correct and wrong images.
The topic ‘[Closed] Still issues after applying your code fix’ is closed to new replies.