WordPress.org

Ready to get started?Download WordPress

Forums

Multiple Post Thumbnails
Images not working in Nivo Slider (2 posts)

  1. yofx
    Member
    Posted 2 years ago #

    I am trying to get this plugin to work with the Nivo Slider. In the functions.php I assigned the secondary feature image to be named slideshow-image.

    Here is the original code for the Nivo Slider referencing the standard Feature Image.

    <div id="slider" class="nivoSlider">
    <?php while($featured_posts->have_posts()): $featured_posts->the_post(); ?>
    <?php if(has_post_thumbnail()): ?>
    <?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'feature-image'); ?>
    <?php $image_thumb = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'featured-image-thumb'); ?>
    <a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><img src="<?php echo $image[0]; ?>" alt="<?php the_title(); ?>" title="#htmlcaption_<?php the_ID(); ?>" rel="<?php echo $image_thumb[0]; ?>" width='516' height='340' /></a>
    <?php else: ?>
    <a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php bloginfo('template_directory'); ?>/images/thumbnail.png&w=516&h=340" alt="<?php the_title(); ?>" title="#htmlcaption_<?php the_ID(); ?>" rel="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php bloginfo('template_directory'); ?>/images/thumbnail.png&w=70&h=60" width='516' height='340' /></a>
    <?php endif; ?>
    <?php endwhile; ?>
    </div>

    I tried putting the following code in but didn't work.

    <?php if (class_exists('MultiPostThumbnails')
        && MultiPostThumbnails::has_post_thumbnail('post', 'slideshow-image')) :
            MultiPostThumbnails::the_post_thumbnail('post', 'slideshow-image'); ?>
    
    <?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'slideshow-image'); ?>
    
    <?php $image_thumb = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'slideshow-image-thumb'); ?>

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

  2. TaskWrangler
    Member
    Posted 1 year ago #

    I'm trying to do the same thing. Did you ever get it to work?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic