dlanger / simple-slideshow Goto Github PK
View Code? Open in Web Editor NEWA simple jQuery+Cycle Lite Wordpress slideshow plugin
License: BSD 2-Clause "Simplified" License
A simple jQuery+Cycle Lite Wordpress slideshow plugin
License: BSD 2-Clause "Simplified" License
The file jquery-ui-1.8.15.custom.min.js includes jQuery UI and four more jQuery UI components that WordPress core already make available; please modify your plugin to call the core scripts as dependencies instead of overwriting them with your own.
Hey there...love the plugin! I was just wondering if it is possible to change the default size values (in pixels) for the large, medium, and thumbnail size options because there is a huge gap between the control buttons and my image (and I believe that it's due to the fact that these default values are much larger than the actual image itself). Any guidance would be appreciated!
For your reference, check out a screenshot here:
http://www.dukefashion.org/blog/tickets/formmag_screenticket_A.tiff
Thanks so much,
Aaron
Hi,
Great plugin! I am having one issue though. THe previous / next buttons are stacking vertically on oneanther. Can't seem to get them to be on same line. This is only happening in Large mode. Medium mode the problem does not exist. Any Thoughts?
Thank you in advance
I actually added support for this, working off the codebase hosted on WordPress.org.
I forked afterwards so I could send you a pull request, but it seems there's quite a bit of difference between the two. Which one is more current?
Is it possible to include captions per post?
When simple-slideshow is enabled, the Insert/edit link button on the toolbar in the pages & posts editing screens no longer works properly. The 'Enter the destination URL' dialogue box shows up below the bottom left of the screen (so you have to scroll down), and you can't exit that dialogue box without refreshing the page (cancel doesn't work).
Adding links works fine as soon as the slideshow plugin is disabled. I'm on WordPress 3.5.1.
Any clues?
The code at line 104 in simpleslider.php ver. 1.2 gets the image width and height from the metadata. But the chosen $size, such as 'medium', may not exist in the metadata. It is better to get the dimensions from wp_get_attachment_image_src(), which is called later anyway.
For instance, on my site I uploaded images 180x233, 174x233, 147x233. With default WP settings, those numbers are stored at the top level of the meta, and there is only one specific $size, 'thumbnail'. So the existing code at line 104 results in the div having style="width: 0px; height: 0px;". This makes for confusing formatting.
Simple fix:
<?php
............................. line 99
// Figure out the maximum size of the images being displayed so we can
// set the smallest possible fixed-size container to cycle in.
$thumb_w = $thumb_h = 0;
$captions = array();
+ $image_props = array(); // cache the calls to wp_get_attachment_image_src()
foreach ( $images as $image_id => $image_data ) {
- $info = wp_get_attachment_metadata( $image_id );
- $thumb_w = max ( $thumb_w, $info[ 'sizes' ][ $size ][ 'width' ] );
- $thumb_h = max ( $thumb_h, $info[ 'sizes' ][ $size ][ 'height' ] );
$captions[ $image_id ] = $image_data->post_excerpt;
+
+ // Metadata may not have the chosen size $size
+ // (missing $info[ 'sizes' ][ $size ][ 'width' ] and [ 'height' ]),
+ // which means the main image will be used
+ // (with dimensions $info[ 'width' ] and [ 'height' ]).
+
+ // Rather than check both parts of the metadata,
+ // the dimension of the image that will be used
+ // can be found by using the call to wp_get_attachment_image_src().
+ // Cache the call in $image_props.
+
+ $image_props[ $image_id ] = wp_get_attachment_image_src( $image_id, $size );
+ $thumb_w = max ( $thumb_w, $image_props[ $image_id ][ 1 ] );
+ $thumb_h = max ( $thumb_h, $image_props[ $image_id ][ 2 ] );
}
$slider_show_id = 'simpleslider_show_' . get_the_ID();
$slider_show_number = get_the_ID();
............................. line 127
$first = true;
foreach ( $images as $image_id => $image_data ) {
$opacity = $first ? '1' : '0';
$first = false;
- $image_prop = wp_get_attachment_image_src( $image_id, $size );
+ $image_prop = $image_props[ $image_id ];
$image_tag = "<img src=\"${image_prop[ 0 ]}\" " .
"width=\"${image_prop[ 1 ]}\" " .
"height=\"${image_prop[ 2 ]}\" " .
"alt=\"${captions[ $image_id ]}\">";
.............................
?>
How can I post this into a static page? It only seems to work in a post. Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.