GithubHelp home page GithubHelp logo

dlanger / simple-slideshow Goto Github PK

View Code? Open in Web Editor NEW
9.0 9.0 3.0 495 KB

A simple jQuery+Cycle Lite Wordpress slideshow plugin

License: BSD 2-Clause "Simplified" License

PHP 89.19% Shell 8.63% JavaScript 2.18%

simple-slideshow's People

Contributors

dlanger avatar robcolburn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

simple-slideshow's Issues

Custom jQuery UI components break in WordPress 3.5

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.

Awkward Gap!

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

Previous / Next Buttons stacking

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

Multiple slideshows on one post

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?

Captions

Is it possible to include captions per post?

Insert link in editor breaks

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?

Fix for missing dimensions

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 ]}\">"; 
.............................
?>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.