Support » Plugins » [Plugin: Viper’s Video Quicktags] Same post, differnet size videos on different pages

  • 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.

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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).

    Thread Starter Drew Baker

    (@dbaker)

    Viper,
    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.

    Thanks!

    Add more conditionals inside of the function.

    http://codex.wordpress.org/Conditional_Tags

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Viper’s Video Quicktags] Same post, differnet size videos on different pages’ is closed to new replies.