-
-
Save csknk/8012021 to your computer and use it in GitHub Desktop.
Add post title as a h1 straight after soliloquy slider (between slider & thumbnails)
This file contains 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
<?php | |
/* Add heading to slider */ | |
add_filter( 'tgmsp_after_slider', 'tgm_soliloquy_custom_title_after_slider', 10, 5 ); | |
function tgm_soliloquy_custom_title_after_slider( $slider, $id, $images, $soliloquy_data, $soliloquy_count ) { | |
if ( '222' == $id ) { // if slider id ==222, don't do anything | |
return $slider; | |
} | |
else { | |
// Build the H1 tag. | |
$page_title = get_the_title($post->ID); | |
$h1 = '<h1 class="headline project_headline">' . $page_title . '</h1>'; | |
// Append the tag to the slider. | |
return $slider . $h1; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment