ID; $key = 'bliss_slideshow'; $slideshow = get_post_meta( $post_id, $key, true ); if($slideshow && $slideshow != '' && $slideshow != 'none'){ $trim = strlen('uses_slideshow_'); $id = substr($slideshow, $trim, 1 ); return (int) esc_attr($id); }else{ return false; } } function bliss_display_slideshow(){ $id = bliss_get_slideshow_id();// this function is defined in metaboxes.php if(!$id || $id == ''){ return ''; } // retrieve slide data from db. // see http://jquery.malsup.com/cycle2/api/ // for information about adding captions etc. // TODO: triggers via prev and next. Use the glyphicons to implement: // data-cycle-next=".next, .cycle-slideshow" data-cycle-prev=".prev" // but will require adding prev and next elements to the slider $string = '
'; return $string; } // this is the function you actually call, to display a slideshow on the page. function bliss_slideshow(){ $slider = bliss_display_slideshow(); if($slider && $slider != ''){ printf('