• Resolved ToreKarlsson

    (@torekarlsson)


    Hello!

    I have a problem when I try to set a custom resolution on thumbnails for Youtube. It seems like this plugin just looks at the last ID and applies that to all instead of looping through all individual post.

    It seems like $post always is the same, can that be right?

    I think the problem starts in frontend => class-youtube.php.

    function thumbnailquality() {
    		global $post;
    		$thumbnailquality_default = '0';
    		$thumbnailquality = $thumbnailquality_default;
    
    		if (!isset($post->ID)) {
    			$id = null;
    		}
    		else {
    			$id = $post->ID;
    		}
    
    		// When the individual status for a page/post is '0', all the other setting don't matter.
    		if (
    			( get_post_meta( $id, 'lazyload_thumbnail_quality', true ) && get_post_meta( $id, 'lazyload_thumbnail_quality', true ) === '0' )
    			) {
    			return $thumbnailquality;
    		}
    		elseif (
    			( get_post_meta( $id, 'lazyload_thumbnail_quality', true ) && get_post_meta( $id, 'lazyload_thumbnail_quality', true ) === 'max' )
    			|| ( ( get_post_meta( $id, 'lazyload_thumbnail_quality', true ) !== '0' ) && ( get_option('lly_opt_thumbnail_quality') === 'max' ) )
    			) {
    			$thumbnailquality = 'maxresdefault';
    		}
    
    		return $thumbnailquality;
     	}

    Thank you in advanced!

    https://wordpress.org/plugins/lazy-load-for-videos/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter ToreKarlsson

    (@torekarlsson)

    Does anyone know any solution to this problem?

    Plugin Author kevinweber

    (@kevinweber)

    Hi,
    can you be more explicit? Can you send me a link to your site so that I can see the problem?
    How do you set a custom resolution?

    Best regards,
    Kevin

    Thread Starter ToreKarlsson

    (@torekarlsson)

    Hello,

    I’m sorry but I can’t send you a URL cause the site is still in development and hidden. I will try to explain a little more:
    I choose to embed this Youtube clip: https://www.youtube.com/watch?v=MPmObvuOMYA and it seems like their is no HI-res image for that one. The problem is that when I try to change this particular post to use a standard res image in the post settings it doesn’t affect anything. It still tries to grab the HI-res image. But when I open the post in a single template it grabs the right image resolution and everything works.

    In a coincidence I tried to change the last published post meta data in my database to standard res instead of HI-res and every one of the Youtube videos got standard resolution images. When I changed it back all videos tried to grab the HI-res image again and because not all has one they failed.

    Any idea?

    Plugin Author kevinweber

    (@kevinweber)

    So everything works fine on single posts, but not within a loop with several posts, am I right?

    Thread Starter ToreKarlsson

    (@torekarlsson)

    Hello!

    Yes that is correct!

    Plugin Author kevinweber

    (@kevinweber)

    Oh, okay, that’s a bug and technically not so easy to solve. I’ll think about a useful solution within the next weeks.

    Thread Starter ToreKarlsson

    (@torekarlsson)

    Thank you! Will you post when you have a solution?

    Plugin Author kevinweber

    (@kevinweber)

    Yes, for sure.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Wrong ID for individual post’ is closed to new replies.