Image thumbnails on entries

Add the following code to the wp-content/themes/YOUR_THEME/functions.php file (or create a plugin for it).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function my_entry_image_thumb()
{
    ?>
<script>
    jQuery(document).ready(function ($) {
        $('.iphorm-entry-cell > a, .iphorm-entry-table td > a').each(function () {
            var $link = $(this),
                href = $link.attr('href');
 
            if (/(jpg|jpeg|png|gif)$/i.test(href)) {
                var $img = $('<img>').attr('src', href).css({ 'max-width': 200, 'max-height': 200 });
                $link.html($img);
            }
        });
    });
</script>
    <?php
}
add_action('admin_footer-quform_page_iphorm_entries', 'my_entry_image_thumb');
function my_entry_image_thumb()
{
    ?>
<script>
    jQuery(document).ready(function ($) {
        $('.iphorm-entry-cell > a, .iphorm-entry-table td > a').each(function () {
            var $link = $(this),
                href = $link.attr('href');

            if (/(jpg|jpeg|png|gif)$/i.test(href)) {
                var $img = $('<img>').attr('src', href).css({ 'max-width': 200, 'max-height': 200 });
                $link.html($img);
            }
        });
    });
</script>
    <?php
}
add_action('admin_footer-quform_page_iphorm_entries', 'my_entry_image_thumb');

Still having trouble? Head over to the forums.

Forums