Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $paged = get_query_var('paged') ? get_query_var('paged') : 1;
- $args = array(
- 'post_type' => array( 'video' ),
- 'post_status' => array( 'publish' ),
- 'posts_per_page' => 5,
- 'paged'=>$paged
- );
- $query = new WP_Query( $args );
- ?>
- <div class="webinars-container">
- <div class="webinar-items">
- <h2>Latest Webinars</h2>
- <?php
- if ( $query->have_posts() ) {
- while ( $query->have_posts() ) { $query->the_post();
- ?>
- <div class="webinar-item">
- <div class="video-link">
- <?php
- $media = rwmb_meta( 'mb_video_link', get_the_ID() );
- echo $media;
- ?>
- </div>
- <div class="video-text">
- <h3 class="video-title"><?php echo get_the_title(); ?></h3>
- <p class="video-desc">
- <?php
- $desc = rwmb_meta( 'mb_video_description', get_the_ID() );
- echo apply_filters('the_content', $desc );
- ?>
- </p>
- </div>
- </div>
- <?php }
- echo '<div class="pagination" style="text-align:center; padding: 30px">';
- $big = 999999999; // need an unlikely integer
- echo paginate_links( array(
- 'base' => str_replace( $big, '%#%', get_pagenum_link( $big ) ),
- 'format' => '?paged=%#%',
- 'current' => max( 1, get_query_var('paged') ),
- 'total' => $query->max_num_pages
- ) );
- echo '</div>';
- } else { ?>
- <h3>No videos found</h3>
- <?php }
- // Restore original Post Data
- wp_reset_postdata();
- ?>
- </div>
Add Comment
Please, Sign In to add comment