Skip to content

Instantly share code, notes, and snippets.

@ericakfranz
Last active August 29, 2015 14:19
Show Gist options
  • Save ericakfranz/b5780d579054c9f604a1 to your computer and use it in GitHub Desktop.
Save ericakfranz/b5780d579054c9f604a1 to your computer and use it in GitHub Desktop.
Soliloquy titled caption plugin.
<?php
/**
* Plugin Name: Soliloquy Titled Caption
* Plugin URI: http://soliloquywp.com/
* Description: Customizes the Soliloquy caption output to show the title before the caption text.
* Version: 1.0.0
* Author: Erica Franz
* Author URI: https://fatpony.me
*/
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
add_filter( 'soliloquy_output_caption', 'soliloquy_title_before_caption', 10, 5 );
function soliloquy_title_before_caption( $caption, $id, $slide, $data, $i ) {
// Check if current slide has a title specified
if ( isset( $slide['title'] ) && !empty( $slide['title'] ) ) {
$caption = '<h4 class="title">' . $slide['title'] . '</h4>';
$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