WordPress.org

Ready to get started?Download WordPress

Forums

Slideshow
Fix for images too tall (1 post)

  1. Tim Priebe
    Member
    Posted 3 years ago #

    Using http://wordpress.org/extend/plugins/slideshow/ ?

    If your images are too tall, you can add the following to the end of slideshow.php:

    function removeImageWidthHeight($html) {
        $doc = Domdocument::loadhtml($html);
        foreach ($doc->getelementsbytagname('img') as $image)
            foreach (array('width', 'height') as $attribute_to_remove)
                if ($image->hasattribute($attribute_to_remove))
                    $image->removeattribute($attribute_to_remove);
        return $doc->savehtml();
    }

    Then, right before this line:

    return apply_filters( 'slideshow_shortcode', $slideshow );

    Add this:

    $slideshow = removeImageWidthHeight($slideshow);

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags