Using the NextGen Gallery Plugin…when it cannot find the image it is looking for it displays an error message, which is generated as an image. I think the message itself may vary, but here is what I’ve seen for the message “Error: File Not Found”:
I want to eliminate these error messages — or at least keep them from displaying or hide them when they do occur.
I believe I found the code that calls these messages in the ImageMagick files within the NextGen Gallery Plugin folder. I may be able to pull that code from the plugin, but I don’t want to do that. I’d like to find another solutions, either by adding some function to my theme’s functions.php or using or jQuery. The problem is that when this message/image gets displayed, the URL is still the same as when it finds the image, so I don’t see any way to target the image and hide it ONLY when the error message gets displayed.
What I’d like to do is use a function in functions.php to somehow intercept the code that tells NGG/ImageMagick that the image is missing, so I can use it as a conditional to prevent the image from displaying if it is not found.
The code I’m using is adapted from code I found somewhere (sorry, don’t remember exactly where) that allows for random display of an NGGallery image. I’m using it as a CSS Background image. Here is my code at pastebin:
Somewhere in this code I want to be able to add a conditional that basically says:
IF THE IMAGE IS NOT FOUND, WHICH CAUSES THE ERROR MESSAGE TO FIRE, THEN RETURN “style=’background-image: none;’
Anyone have any ideas how this might be accomplished without modifying the plugin files?
- The topic ‘NextGen Gallery eliminate displayed error messages’ is closed to new replies.