Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id="carousel" class="carousel slide col-lg-8 col-md-8 col-sm-8 col-xs-8" data-ride="carousel" data-interval="0">
- <!-- Wrapper for slides -->
- <div class="carousel-inner" role="listbox">
- <?php
- $i = 2;
- global $post;
- $args = array(
- 'numberposts' => -1,
- 'post_type' => 'work',
- 'orderby' => 'date',
- 'order' => 'ASC',
- );
- $myposts = get_posts($args);
- if($myposts):
- $chunks = array_chunk($myposts, $i);
- $html = "";
- foreach($chunks as $chunk):
- // Sets as 'active' the first item
- ($chunk === reset($chunks)) ? $active = "active" : $active = "";
- $html .= '<div class="item '.$active.'">';
- foreach($chunk as $post):
- $html .= '<div id="timeline-item" class="col-lg-6 col-md-6 col-sm-6 col-xs-6"><div><span style="text-align: left;">';
- $html .= get_the_date('Y');
- $html .= '</span><h2 style="text-align: left;">';
- $html .= get_the_title($post->ID);
- $html .= '</h2><p style="text-align: left;">';
- $html .= get_post_field('post_content', $post_id);
- $html .= '</p></div></div>';
- endforeach;
- $html .= '</div>';
- endforeach;
- echo $html;
- endif;
- ?>
- </div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement