Skip to content

Instantly share code, notes, and snippets.

@digisavvy
Last active December 19, 2015 01:48
Show Gist options
  • Save digisavvy/5878198 to your computer and use it in GitHub Desktop.
Save digisavvy/5878198 to your computer and use it in GitHub Desktop.
This bit of code will generate a slider based on the post ID of the current page. Just drop this code into your template (functions.php, or elsewhere in your theme's files) and then upload files to your post (don't insert the images into the post, just upload them as attachments) and kaboom! Requires the Soliloquy Dynamic Slider Add-on (sold sep…
function add_image_to_content() {
global $post;
$dg_post_id = $post->ID;
if ( function_exists( 'soliloquy_dynamic' ) )
soliloquy_dynamic(
array( 'id' => "$dg_post_id"
) );
}
// The following are just action hooks and could be removed, if you're not hooking into anything specifically.
add_action( 'thematic_above_categoryloop', 'add_image_to_content', 2 );
add_action( 'thematic_belowsingletop', 'add_image_to_content', 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment