Created
September 19, 2012 16:43
-
-
Save wpsmith/3750689 to your computer and use it in GitHub Desktop.
Adds Thumbnails to Soliloquy Slider
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .soliloquy-container .flex-control-thumbs { | |
| margin: 5px 0 0; | |
| position: static; | |
| } | |
| .soliloquy-container .flex-control-thumbs li { | |
| width: 25%; | |
| float: left; | |
| list-style-type: none; | |
| margin: 0; | |
| } | |
| .soliloquy-container .flex-control-thumbs img { | |
| width: 100%; | |
| display: block; | |
| opacity: .7; | |
| cursor: pointer; | |
| } | |
| .soliloquy-container .flex-control-thumbs img:hover { | |
| opacity: 1; | |
| } | |
| .soliloquy-container .flex-control-thumbs .flex-active { | |
| opacity: 1; | |
| cursor: default; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'tgmsp_control_nav', 'tgm_control_nav', 10, 2 ); | |
| /** | |
| * Changes controlNav to 'thumbnails' for a specific slider ID. | |
| * | |
| * @param boolean $control Default: true/false depending on settings. | |
| * @param int $id Slider ID. | |
| * @return string 'thumbnails' | |
| */ | |
| function tgm_control_nav( $control, $id ) { | |
| if ( 13274 != $id ) return; | |
| return "'thumbnails'"; | |
| } | |
| add_filter( 'tgmsp_slider_item_attr', 'tgm_slider_item_attr', 10, 4 ); | |
| /** | |
| * Changes controlNav to 'thumbnails'. | |
| * | |
| * @param string $attr Default: true/false depending on settings. | |
| * @param int $id Slider ID. | |
| * @param array $image Array of Image Data. | |
| * @param int $i Slide/Image counter. | |
| * @return string thumbnails' | |
| */ | |
| function tgm_slider_item_attr( $attr, $id, $image, $i ) { | |
| if ( 13274 != $id ) return; | |
| $thumb = wp_get_attachment_image_src( $image['id'], 'thumbnail' ); | |
| return 'data-thumb="' . $thumb[0] . '"'; | |
| } | |
| add_filter( 'tgmsp_slider_controls', 'tgm_slider_controls', 10, 2 ); | |
| /** | |
| * Changes controlsContainer to '#flex-container-*' where * is a specific slider ID. | |
| * | |
| * @param boolean $control Default: true/false depending on settings. | |
| * @param int $id Slider ID. | |
| * @return string 'thumbnails' | |
| */ | |
| function tgm_slider_controls( $control, $id ) { | |
| if ( 13274 != $id ) return; | |
| return '#flex-container-' . $id; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment