Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- global $post;
- $captions = array();
- echo "<div id=\"slider\" class=\"nivoSlider\">";
- $args = array(
- 'numberposts' => '-1',
- 'orderby' => 'menu_order',
- 'order' => 'ASC',
- 'post_type' => 'slider_image' );
- $images = get_posts($args);
- for($i=0; $i <= count($images);$i++){
- if($images[$i]->post_title != ''){
- echo get_the_post_thumbnail($images[$i]->ID, 'full', array( 'title' => "#caption".$i+1));
- array_push($captions, $images[$i]->post_title);
- }
- else
- {
- echo get_the_post_thumbnail($images[$i]->ID, 'full');
- }
- }
- echo "</div>";
- print_r($captions);
- $count = 1;
- foreach($captions as $c => $v){
- echo "<div id=\"caption".$c++."\" class=\"nivo-html-caption\">";
- echo $v;
- echo "</div>";
- count++;
- }
- ?>
Add Comment
Please, Sign In to add comment