WordPress.org

Support

Support » Plugins and Hacks » Multiple Post Thumbnails » [Plugin: Multiple Post Thumbnails] Llink to full size image from thumbnail

[Plugin: Multiple Post Thumbnails] Llink to full size image from thumbnail

  • Hi there, I love this plugin – does exactly what I need, although I would like to link through to the full size images from each of the thumbnails. Is there a way to do this?

Viewing 13 replies - 1 through 13 (of 13 total)
  • Same question here!

    Please post a solution for this issue.
    I’d also like to link to the attachment page with fullsize image from each thumbnail. Please help!

    P.S. Plugin is awesome!

    i would also like to know how to do this.

    +1!

    Plugin Author Chris Scott

    @chrisscott

    Thanks for the feedback, everyone. This has been added as an optional arg to the_post_thumbnail and get_the_post_thumbnail in the latest version, 0.4.

    Plugin Author Chris Scott

    @chrisscott

    To use this feature, you’ll need to use something like:

    MultiPostThumbnails::the_post_thumbnail('post', 'secondary-image', NULL, 'post-thumbnail', NULL, true);

    to get a thumbnail using the default image size and link it to the full size.

    How do you just display the full sized version rather than linking to it?

    As the thumbnail version is cropped I need to display the full sized version so I can see the whole thing.

    Seriously… this must be do-able?

    It worked so for me:

    a) functions.php:

    /*Muliple Post Images*/

    if (class_exists(‘MultiPostThumbnails’)) {
    $types = array(‘post’, ‘page’, ‘my_post_type’);
    foreach($types as $type) {
    $thumb = new MultiPostThumbnails(array(
    ‘label’ => ‘Secondary Image’,
    ‘id’ => ‘secondary-image’,
    ‘post_type’ => $type
    )
    );
    }
    }
    /* Größe vergeben (Thumb) */
    add_image_size(‘post-secondary-image-thumbnail’, 250, 180);
    add_image_size(‘page-secondary-image-thumbnail’, 250, 180);

    ?>

    b) page.php (code where you want your secondary image)

    <?php the_secondary_content(); ?>
    <?php if (class_exists(‘MultiPostThumbnails’)
    && MultiPostThumbnails::has_post_thumbnail(‘page’, ‘secondary-image’)) :
    MultiPostThumbnails::the_post_thumbnail(‘page’, ‘secondary-image’, NULL, ‘page-secondary-image-thumbnail’, NULL, TRUE); endif; ?>

    c) and then i open: multi-post-thumbails.php (in plugins)
    and edit line: 204 -> add:

    class=”thickbox” (after “%s” add class=”thickbox”)

    (i add thickbox for my lightbox as class. It can also be lightbox or what you use)

    NOW:
    SO ALL THE Thumbs clickable and the big size are viewed in thickbox/lightbox)

    Worked a treat, thanks newcomdd_gmbh.

    Thanks for the snippet newcomdd_gmbh!

    I know you can achieve the Fancybox effect without edits using e.g. Fancybox Gallery, but was wondering if anyone knew of adding e.g. rel="lightbox" or class="thickbox" without editing the multi-post-thumbnails.php file?

    Hi,

    I could not get any of the above to work?

    This is my code:

    //Functions.php
    //Muliple Featured Images Code
    if (class_exists('MultiPostThumbnails')) {
        new MultiPostThumbnails(array(
        'label' => 'Smaller Featured Image',
        'id' => 'secondary-image',
        'post_type' => 'projects'
        )
    );
    
    add_image_size( 'projects-secondary-image-thumbnail', 218, 166, true );
    }

    //Custom Post Type Project template

    <?php if (class_exists('MultiPostThumbnails')
        && MultiPostThumbnails::has_post_thumbnail('projects', 'secondary-image')) :
            MultiPostThumbnails::the_post_thumbnail('projects', 'secondary-image', NULL, 'projects-secondary-image-thumbnail',NULL, TRUE); endif; ?>

    I also edited line 204 in the plugin file, but the image is just not clickable.

    Thanks

    SOLVED:

    I added $post->ID.

    Here is my snippet:

    <?php if (class_exists('MultiPostThumbnails')
        && MultiPostThumbnails::has_post_thumbnail('projects', 'secondary-image')) :
            MultiPostThumbnails::the_post_thumbnail('projects', 'secondary-image', $post->ID, 'projects-secondary-image-thumbnail',NULL, TRUE); endif; ?>

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘[Plugin: Multiple Post Thumbnails] Llink to full size image from thumbnail’ is closed to new replies.
Skip to toolbar