[Plugin: Viper's Video Quicktags] Same post, differnet size videos on different pages (4 posts)

  1. Drew Baker
    Posted 5 years ago #

    Hey Viper,

    I want to display my videos on the front page (index.php) at 300px wide, but have them 500px when viewing a single post (single.php). Is there a way to view the same video at different sizes?

    Your changelog says that version v6.1.2 added a filter that lets themes resize videos automatically. Would that do it? If so, how? I'm hoping for something similar to the_post_thumb feature.


  2. Try this something like this in your theme's functions.php:

    add_filter( 'vvq_shortcodeatts', 'dbaker_vvq_modifier', 10, 3 );
    function dbaker_vvq_modifier( $atts, $tag, $rawatts ) {
    	if ( is_singular() ) {
    		$atts['width'] = 500;
    		$atts['height'] = 375;
    	return $atts;

    That'll override the width/height in singular views (posts and pages).

  3. Drew Baker
    Posted 5 years ago #

    This is great! Thanks.

    Is there a way to use it twice to allow more sizes? I tried just doubling it up and changing the modifier name, but it doesn't work like that I suppose.

    As a side note, this would be a good note to add into the FAQ on the Plugin page.


  4. Add more conditionals inside of the function.


Topic Closed

This topic has been closed to new replies.

About this Topic