• With the changes below, the slideshow will respect the ‘size’ setting in the gallery shortcode, even for custom sizes.

    diff -cb gallery-slideshow/gallery-slideshow.php gallery-slideshow-vk/gallery-slideshow.php
    *** gallery-slideshow/gallery-slideshow.php	2016-07-12 18:28:56.000000000 +0200
    --- gallery-slideshow-vk/gallery-slideshow.php	2016-12-30 11:42:26.496187957 +0100
    ***************
    *** 25,35 ****
      			wp_register_script( 'gss-custom-js', plugins_url( 'gss-custom.js' , __FILE__ ) );
      			wp_enqueue_script( 'gss-custom-js' );
      		}
    ! 		extract( shortcode_atts( array( 'ids' => '', 'name' => 'gslideshow', 'style' => '', 'options' => '', 'carousel' => '' ), $atts ) );
              if ( !function_exists('gss_html_output') ) {
      			require 'gss_html.php';
      		}
    ! 		$output = gss_html_output($ids,$name,$style,$options,$carousel);
              return $output;
          }
      
    --- 25,35 ----
      			wp_register_script( 'gss-custom-js', plugins_url( 'gss-custom.js' , __FILE__ ) );
      			wp_enqueue_script( 'gss-custom-js' );
      		}
    ! 		extract( shortcode_atts( array( 'ids' => '', 'name' => 'gslideshow', 'size' => 'full', 'style' => '', 'options' => '', 'carousel' => '' ), $atts ) );
              if ( !function_exists('gss_html_output') ) {
      			require 'gss_html.php';
      		}
    ! 		$output = gss_html_output($ids,$name,$size,$style,$options,$carousel);
              return $output;
          }
      
    
    diff -cb gallery-slideshow/gss_html.php gallery-slideshow-vk/gss_html.php
    *** gallery-slideshow/gss_html.php	2014-04-11 14:54:14.000000000 +0200
    --- gallery-slideshow-vk/gss_html.php	2016-12-30 11:39:51.282229298 +0100
    ***************
    *** 1,6 ****
      <?php
      
    ! function gss_html_output($ids,$name,$style,$options,$carousel) {
      	$ids = explode( ',', $ids );
      	$slide_count = count($ids);
      	$options = html_entity_decode($options);
    --- 1,6 ----
      <?php
      
    ! function gss_html_output($ids,$name,$size,$style,$options,$carousel) {
      	$ids = explode( ',', $ids );
      	$slide_count = count($ids);
      	$options = html_entity_decode($options);
    ***************
    *** 14,20 ****
      	$pager = "\n\t\t\t<div id=\"" . $name . '_pager" class="gss-pager"></div>';
      	foreach( $ids as $image_id ){
      		$attachment = get_post( $image_id, 'ARRAY_A' );
    ! 		$src = wp_get_attachment_image_src( $image_id, 'full' );
      		$excerpt = htmlspecialchars($attachment['post_excerpt']);
      		$slides .= "\n\t\t\t<img src=\"$src[0]\" alt=\"$excerpt\" />\n";
      		if( !empty($carousel) ){
    --- 14,20 ----
      	$pager = "\n\t\t\t<div id=\"" . $name . '_pager" class="gss-pager"></div>';
      	foreach( $ids as $image_id ){
      		$attachment = get_post( $image_id, 'ARRAY_A' );
    ! 		$src = wp_get_attachment_image_src( $image_id, $size );
      		$excerpt = htmlspecialchars($attachment['post_excerpt']);
      		$slides .= "\n\t\t\t<img src=\"$src[0]\" alt=\"$excerpt\" />\n";
      		if( !empty($carousel) ){
    
  • The topic ‘Diff to make slideshow respect the ‘size’ parameter’ is closed to new replies.