Last active
August 29, 2015 14:13
-
-
Save ericakfranz/b7855844138e66808e3e to your computer and use it in GitHub Desktop.
Output Title of Soliloquy Slider before images and container.
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
/** | |
* 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>'; | |
} |
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
/** | |
* 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>'; | |
} |
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
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