WordPress.org

Ready to get started?Download WordPress

Forums

Multiple Post Thumbnails
How to link to a bigger sized image (4 posts)

  1. Ramzii
    Member
    Posted 2 years ago #

    Hi there, first of all, my compliments for something wordpress shouldve implemented a long time ago, hope they offer you a job! lol

    Anyhow, the topic title says it all.

    I have 3 thumbnails, kinda small.. would like each thumbnail to link to a bigger version of itself. I dont mind how big, pre-fixed WordPress sizes are okay also. Just bigger than a thumbnail should do it.

    Is this possible? If so how. Thanks a bunch!

    This is my current code btw:

    <div class="container_thumbs">
                        <div class="custom_thumbje"><a href="<?php the_permalink();?>"><?php if (class_exists('MultiPostThumbnails')
                        && MultiPostThumbnails::has_post_thumbnail('post', 'secondary-image')) :
                           MultiPostThumbnails::the_post_thumbnail('post', 'secondary-image', NULL, 'eigen_custom_size_thumbnail');
                        endif; ?></a></div>
    
                        <div class="custom_thumbje"><?php if (class_exists('MultiPostThumbnails')
                        && MultiPostThumbnails::has_post_thumbnail('post', 'tertiary-image')) :
                           MultiPostThumbnails::the_post_thumbnail('post', 'tertiary-image', NULL, 'eigen_custom_size_thumbnail');
                        endif; ?></div>
    
                        <div class="custom_thumbje"><?php if (class_exists('MultiPostThumbnails')
                        && MultiPostThumbnails::has_post_thumbnail('post', 'quaternary-image')) :
                           MultiPostThumbnails::the_post_thumbnail('post', 'quaternary-image', NULL, 'eigen_custom_size_thumbnail');
                        endif; ?></div>
                  </div>

    http://wordpress.org/extend/plugins/multiple-post-thumbnails/

  2. stjohn79
    Member
    Posted 2 years ago #

  3. Ramzii
    Member
    Posted 2 years ago #

    Thank you! But im having a hard time implementing it:
    My test code currently:

    <div class="custom_thumbje">
                            <a target="_blank" href="<?php MultiPostThumbnails::the_post_thumbnail('post', 'secondary-image', NULL, 'secondary-image' , array('class' => 'giga_groot'),false);?>">
    							<?php if (class_exists('MultiPostThumbnails')
                                && MultiPostThumbnails::has_post_thumbnail('post', 'secondary-image')) :
                                   MultiPostThumbnails::the_post_thumbnail('post', 'secondary-image', NULL, 'eigen_custom_size_thumbnail');
                                endif; ?>
                            </a>
                        </div>

    It results in linking to a broken and incomplete URL:

    "http://www.domain.com/<img width="

    Any ideas?

  4. Ramzii
    Member
    Posted 2 years ago #

    Funny, when reading the source it reads: http://pastebin.com/hvC6qaHC

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic