Soliloquy Documentation

Documentation, Reference Materials, and Tutorials for Soliloquy

Add Custom HTML to Slides

Important: This doc assumes you’re comfortable creating and/or editing PHP files in your WordPress installation and is intended for advanced users.

You can add custom HTML to your slides, appending it to the output of each slide’s caption (if defined).

To add custom HTML to your slides, add the following to your active theme’s functions.php file and edit as you require. Change the ID to match the slider you want to target and have fun!

add_filter( 'soliloquy_output_caption', 'tgm_soliloquy_custom_html', 10, 4 );
function tgm_soliloquy_custom_html( $html, $id, $image, $i ) {
    
    // If the ID doesn't match the one we want to modify, return the default HTML output. Change 324 to your image ID.
    if ( 324 !== $id )
        return $html;
        
    // Append custom code output of the caption to do whatever.
    $html .= '<div class="my-custom-class"><p>My custom stuff!</p></div>';
    
    // Return the modified HTML output.
    return $html;
    
}
[i]
[i]