WordPress.org

Forums

Multiple Post Thumbnails
Secondary thumbnaillink to original (3 posts)

  1. RuneNL
    Member
    Posted 2 years ago #

    Hi,

    Due to my lack of knowledge I would like to borrow yours.

    Currently I have linked the default thumbnail to the original image with a lightbox.

    I would like to do the same with the secondary-image but for the life of me, I can not get it to work.

    <?php
      if ( class_exists('MultiPostThumbnails')) {
      $large_image_url = wp_get_attachment_image_src( MultiPostThumbnails::the_post_thumbnail($post->ID), 'large');
       echo '<a href="' . $large_image_url[0] . '" title="' . the_title_attribute('echo=0') . '" rel="slb_internal" >';
       echo MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'secondary-image', NULL, array(93,93), 'post-secondary-image-thumbnail');
       echo '</a>';
     }
    ?>

    Can anyone tell me what I am doing wrong and if so offer me a solution?

    Thank you in advanced.

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

  2. RuneNL
    Member
    Posted 2 years ago #

    Anyone?

    All I am trying to do is making the second thumbnail a link to the original.

    Tried to figure it out with the documented information and rooting through the plugin files.

    <?php
    if ( class_exists('MultiPostThumbnails')) {
    $large_image_url = MultiPostThumbnails::get_post_thumbnail_url(get_post_type($post->ID), 'secondary-image');
    echo '<a href="' . $large_image_url[0] . '" title="' . the_title_attribute('echo=0') . '" rel="slb_internal" >';
    echo MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'secondary-image', NULL,  'post-secondary-image-thumbnail');
    echo '</a>';
    }
    ?>
  3. RuneNL
    Member
    Posted 2 years ago #

    (Hid src="Correct image URL" on request of customer, reason: development environment)

    This is the HTML output:

    <div class="tekst-markup-image2">
    
    <a href="h" title="1 Kamer studio appartement" rel="slb_internal"><img width="93" height="69" src="Correct image URL" class="attachment-post-secondary-image-thumbnail" alt="Straat aanzicht"></a>
    </div>

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Multiple Post Thumbnails
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic