WordPress.org

Ready to get started?Download WordPress

Forums

Multiple Post Thumbnails
Llink to full size image from thumbnail (14 posts)

  1. Gergster
    Member
    Posted 3 years ago #

    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?

  2. Christoph
    Member
    Posted 3 years ago #

    Same question here!

  3. okuzub
    Member
    Posted 3 years ago #

    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!

  4. lukeshumard
    Member
    Posted 3 years ago #

    i would also like to know how to do this.

  5. gfors
    Member
    Posted 3 years ago #

    +1!

  6. Chris Scott
    Member
    Plugin Author

    Posted 3 years ago #

    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.

  7. Chris Scott
    Member
    Plugin Author

    Posted 3 years ago #

    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.

  8. brad8985
    Member
    Posted 3 years ago #

    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.

  9. brad8985
    Member
    Posted 3 years ago #

    Seriously... this must be do-able?

  10. newcomdd_gmbh
    Member
    Posted 3 years ago #

    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)

  11. Atlantic
    Member
    Posted 3 years ago #

    Worked a treat, thanks newcomdd_gmbh.

  12. flick
    Member
    Posted 2 years ago #

    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?

  13. welshhuw
    Member
    Posted 2 years ago #

    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

  14. welshhuw
    Member
    Posted 2 years ago #

    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; ?>

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic