Skip to content

Instantly share code, notes, and snippets.

@ericakfranz
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericakfranz/b7855844138e66808e3e to your computer and use it in GitHub Desktop.
Save ericakfranz/b7855844138e66808e3e to your computer and use it in GitHub Desktop.
Output Title of Soliloquy Slider before images and container.
/**
* Plugin Name: Globally Titled Soliloquy
* Plugin URI: http://soliloquywp.com
* Version: 1.0
* Author: Erica Franz
* Author URI: http://fatpony.me/
* Description: Display Soliloquy Slider Title before slider - globally.
*/
add_filter( 'soliloquy_output_start', 'ekf_titled_soliloquy', 10, 2 );
function ekf_titled_soliloquy($output, $data) {
if( empty( $data['id'] ) ){
return;
}
$sol_id = $data['id'];
return '<h2 class="soliloquy-title">' . get_the_title( $sol_id ) . '</h2>';
}
/**
* Plugin Name: Titled Soliloquy
* Plugin URI: http://soliloquywp.com
* Version: 1.0
* Author: Erica Franz
* Author URI: http://fatpony.me/
* Description: Display Soliloquy Slider Title before slider.
*/
add_filter( 'soliloquy_output_start', 'ekf_titled_soliloquy', 10, 2 );
function ekf_titled_soliloquy($output, $data) {
// ID's of specific sliders to show title of
$slidersToShowTitles = array(
17,
18
);
// Check if we need to display title of this slider
if( empty( $data['id'] ) || !in_array( $data['id'], $slidersToShowTitles ) ){
return;
}
$sol_id = $data['id'];
return '<h2 class="soliloquy-title">' . get_the_title( $sol_id ) . '</h2>';
}
h2.soliloquy-title {
padding: 2em 2em 1em;
text-align: center;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment