WordPress.org

Support

Support » Plugins and Hacks » Multiple Post Thumbnails » [Resolved] [Plugin: Multiple Post Thumbnails] array add class not working

[Resolved] [Plugin: Multiple Post Thumbnails] array add class not working

Viewing 1 replies (of 1 total)
  • This seemed to do the trick:

    if (class_exists('MultiPostThumbnails')) {
              $image_name = "sidebar-image";
                    if (MultiPostThumbnails::has_post_thumbnail('page', $image_name)) {
                        $image_id = MultiPostThumbnails::get_post_thumbnail_id( 'page', $image_name, $post->ID );
                        $attr = array('class' => "border-1");
                        $image = wp_get_attachment_image( $image_id, 'sidebar-image', false, $attr );
                        echo $image;
                    }
            };
Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] [Plugin: Multiple Post Thumbnails] array add class not working’ is closed to new replies.
Skip to toolbar