WordPress.org

Ready to get started?Download WordPress

Forums

Multiple Post Thumbnails
Changing size of linked image in lightbox (1 post)

  1. vikkineal
    Member
    Posted 1 year ago #

    Hi
    Hoping someone can help.

    Following other posts I have managed to set my featured images to open the larger version of themselves in a slimbox - however, how can I change the size of the main image that's in the overlay?

    This is the code that has been edited in multi-post-thumbnails.php - from line 269...

    * Retrieve Post Thumbnail.
    		 *
    		 * @param string $post_type The post type.
    		 * @param string $thumb_id The id used to register the thumbnail.
    		 * @param int $post_id Optional. Post ID.
    		 * @param string $size Optional. Image size.  Defaults to 'thumbnail'.
    		 * @param bool $link_to_original Optional. Wrap link to original image around thumbnail?
    		 * @param string|array $attr Optional. Query string or array of attributes.
    		  */
    		public static function get_the_post_thumbnail($post_type, $thumb_id, $post_id = NULL, $size = 'post-thumbnail', $attr = '' , $link_to_original = false) {
    			global $id;
    			$post_id = (NULL === $post_id) ? get_the_ID() : $post_id;
    			$post_thumbnail_id = self::get_post_thumbnail_id($post_type, $thumb_id, $post_id);
    			$size = apply_filters("{$post_type}_{$post_id}_thumbnail_size", $size);
    			if ($post_thumbnail_id) {
    				do_action("begin_fetch_multi_{$post_type}_thumbnail_html", $post_id, $post_thumbnail_id, $size); // for "Just In Time" filtering of all of wp_get_attachment_image()'s filters
    				$html = wp_get_attachment_image( $post_thumbnail_id, $size, false, $attr );
    				do_action("end_fetch_multi_{$post_type}_thumbnail_html", $post_id, $post_thumbnail_id, $size);
    			} else {
    				$html = '';
    			}
    
    			if ($link_to_original && $html) {
    				$html = sprintf('<a href="%s" rel="lightbox-gallery">%s</a>', wp_get_attachment_url($post_thumbnail_id), $html);
    			}
    
    			return apply_filters("{$post_type}_{$thumb_id}_thumbnail_html", $html, $post_id, $post_thumbnail_id, $size, $attr);
    		}

    I'm assuming my 'large' size would need to go in here, I'm just not sure how...

    Thank!

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic