Soliloquy Documentation
Documentation, Reference Materials, and Tutorials for Soliloquy
Documentation, Reference Materials, and Tutorials for Soliloquy
Would you like to add link classes to your Soliloquy lightbox images? We can walk you through each step on how to do this! Follow the tutorial below to add custom link classes to your Soliloquy lightbox images.
Note: This tutorial is a bit more technical than our other docs, but we’ll walk you through the process step by step. In order to add custom link classes, we’ll need to create and upload a basic WordPress plugin.
To automatically add custom class names to lightbox links and video lightbox links, just add the following code to a new file at wp-content/plugins/soliloquy-add-link-classes.php
.
/** Add CSS classes to image slide links */
function sol_soliloquy_add_image_classes( $classes, $id, $item, $data, $i ) {
$classes[] = ‘my-class’;
return $classes;
}
add_filter( ‘soliloquy_get_image_slide_link_classes’, ‘sol_soliloquy_add_image_classes’, 10, 5 );
/** Add CSS classes to video slide links */
function sol_soliloquy_add_video_classes( $classes, $id, $item, $data, $i ) {
$classes[] = ‘my-class’;
return $classes;
}
add_filter( ‘soliloquy_get_video_slide_link_classes’, ‘sol_soliloquy_add_video_classes’, 10, 5 );[/php]
If you’re unsure how to create a plugin file, follow these steps below:
soliloquy-add-link-classes.php
Your next step is to activate the plugin you just uploaded. Simply navigate to the Plugins from within your WordPress dashboard and activate the Soliloquy – Add Classes to Links plugin.
You can now inspect your image and see the new class added to the image link.
Would you like to see how easy it is to add a custom class to the slider item? Take a look at our article on How to Output Custom Slider Item CSS Classes.