Created
July 6, 2015 23:43
-
-
Save ericakfranz/d43d9c730ef1f371911b to your computer and use it in GitHub Desktop.
Move Soliloquy slider caption inside slide link tag and remove default caption output.
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
// remove the default caption output | |
add_filter( 'soliloquy_output_caption', 'soliloquy_empty_default_caption', 10, 5 ); | |
function soliloquy_empty_default_caption( $caption, $id, $slide, $data, $i ) { | |
return $caption; | |
} | |
// add new caption output within the slide item's link tag | |
add_filter( 'soliloquy_output_after_image', 'soliloquy_caption_inside_slide_link', 10, 5 ); | |
function soliloquy_caption_inside_slide_link( $caption, $id, $slide, $data, $i ) { | |
if ( isset( $slide['caption'] ) && !empty( $slide['caption'] ) ) { | |
$caption = '<div class="caption">' . $slide['caption'] . '</div>'; | |
} | |
return $caption; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment