Skip to content

Instantly share code, notes, and snippets.

@csknk
Forked from thomasgriffin/gist:8011213
Last active December 31, 2015 16:09
Show Gist options
  • Save csknk/8012021 to your computer and use it in GitHub Desktop.
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)
<?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