I decided to expand my art gallery to include some FLVs and MP3s and found that my trusty Zenpressed plugin doesn't check if the file is an FLV or an MP3, and instead just tries to embed the mp3/flv as a thumbnail.

I looked around for a few different plugins that would recognise the multimedia formats, but none of them were as awesome as Zenpressed. Zenpressed hadn't been updated since the dawn of time so I didn't expect to find any help from their website.

Instead I dove in to the code and created a small hack for multimedia formats.


It seemed fairly simple enough. At the moment, the plugin takes the image url and uses it as a thumbnail.
For multimedia formats, Zenphoto requires an image to be made with the same filename as the multimedia file, uploaded to the same folder as the file.
For example, the thumbnail for mymovie.flv would be mymovie.jpg, so all I really needed to do was put a script in that removed the file extension and add ".jpg" to the end of the url.

And guess what? It really was that simple.


  1. Navigate to your [wordpress install directory]/wp-includes/plugins folder.
    Download your zenpressed.php file, create another copy of it and back it up somewhere safe just to be careful.
  2. Open up the zenpressed.php file in your favourite code editor.
  3. Find line number 75
    The line below it should start with:
    // Output
    $c =

    This is where the file starts it's output, we want to modify the filename URL before then, so on line 75 enter the following code:
    // Multimedia Replacement mod by - Replaces image.flv with image.jpg
        // Get last three characters from filename
        $se = substr($s,-3);
        // Check if FLV or MP3
        if ($se == "flv" or $se == "mp3") {
            // Remove last 3 characters from image filename, "flv"
            $s = substr($s, 0, -3);
            // Add "jpg" to filename
    // End Multimedia Replacement mod by

    WARNING: If you have modified your zenpressed.php file in any way or have downloaded a fork or pre-modified version of it, then your line number will possibly not match. Please make sure you have the official version to make sure you are putting the code in the right place.

    If you have a modified version of zenpressed you might not be sure what line to put this code on.
    It goes in the zenpressed_showphoto function, under the "generate data" section and before the "output" section.

  4. Save and reupload the file and you're good to go!