Skip to main content
deleted 885 characters in body
Source Link
Desi
  • 1.2k
  • 4
  • 37
  • 54

Update

                <?php
                
                    function movies_posts_per_page( $query ) {
                        // exit out if it's the admin or it isn't the main query
                        if ( is_admin() || ! $query->is_main_query() )
                            return;
                        // so its not admin, and its the main query, is it the movies post archive?
                        if ( is_post_type_archive( 'movies' ) ) {
                            // it is!! Set the posts_per_page to 6
                            $query->set( 'posts_per_page', 6 );
                            return;
                        }
                    }
                    add_action( 'pre_get_posts', 'movies_posts_per_page', 1 );
                
                    if (have_posts()) : while (have_posts()) : the_post();
                    
                    $custom = get_post_custom($post->ID);
                    $movie_info = $custom["movie_info"][0];
                ?>

                   << LOOP GOES HERE >>

                <?php endwhile; ?>

                <?php my_paginate_links(); ?>
                
                <?php endif; ?>

Update

                <?php
                
                    function movies_posts_per_page( $query ) {
                        // exit out if it's the admin or it isn't the main query
                        if ( is_admin() || ! $query->is_main_query() )
                            return;
                        // so its not admin, and its the main query, is it the movies post archive?
                        if ( is_post_type_archive( 'movies' ) ) {
                            // it is!! Set the posts_per_page to 6
                            $query->set( 'posts_per_page', 6 );
                            return;
                        }
                    }
                    add_action( 'pre_get_posts', 'movies_posts_per_page', 1 );
                
                    if (have_posts()) : while (have_posts()) : the_post();
                    
                    $custom = get_post_custom($post->ID);
                    $movie_info = $custom["movie_info"][0];
                ?>

                   << LOOP GOES HERE >>

                <?php endwhile; ?>

                <?php my_paginate_links(); ?>
                
                <?php endif; ?>
added 744 characters in body
Source Link
Desi
  • 1.2k
  • 4
  • 37
  • 54

Update

                <?php
                
                    function movies_posts_per_page( $query ) {
                        // exit out if it's the admin or it isn't the main query
                        if ( is_admin() || ! $query->is_main_query() )
                            return;
                        // so its not admin, and its the main query, is it the movies post archive?
                        if ( is_post_type_archive( 'movies' ) ) {
                            // it is!! Set the posts_per_page to 6
                            $query->set( 'posts_per_page', 6 );
                            return;
                        }
                    }
                    add_action( 'pre_get_posts', 'movies_posts_per_page', 1 );
                
                    if (have_posts()) : while (have_posts()) : the_post();
                    
                    $custom = get_post_custom($post->ID);
                    $movie_info = $custom["movie_info"][0];
                ?>

                   << LOOP GOES HERE >>

                <?php endwhile; ?>

                <?php my_paginate_links(); ?>
                
                <?php endif; ?>

Update

                <?php
                
                    function movies_posts_per_page( $query ) {
                        // exit out if it's the admin or it isn't the main query
                        if ( is_admin() || ! $query->is_main_query() )
                            return;
                        // so its not admin, and its the main query, is it the movies post archive?
                        if ( is_post_type_archive( 'movies' ) ) {
                            // it is!! Set the posts_per_page to 6
                            $query->set( 'posts_per_page', 6 );
                            return;
                        }
                    }
                    add_action( 'pre_get_posts', 'movies_posts_per_page', 1 );
                
                    if (have_posts()) : while (have_posts()) : the_post();
                    
                    $custom = get_post_custom($post->ID);
                    $movie_info = $custom["movie_info"][0];
                ?>

                   << LOOP GOES HERE >>

                <?php endwhile; ?>

                <?php my_paginate_links(); ?>
                
                <?php endif; ?>
Tweeted twitter.com/#!/StackWordPress/status/290851572076904448
added 382 characters in body
Source Link
Desi
  • 1.2k
  • 4
  • 37
  • 54
                    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
                    $movie_query$loop = new WP_Query( array(
                        'post_type' => 'movies',
                        'paged' => $paged,
                        'posts_per_page' => 6
                    ));
                    
                    if($movie_query$loop->have_posts()){
                        while ( $movie_query$loop->have_posts() ) {
                            $movie_query$loop->the_post();

                            << LOOP GOES HERE >>


                   <?php
                      }
                   }
                   my_paginate_links();
                   wp_reset_postdata();
                   ?>
                    $c=0;
                    $i=1;
                    
                    $temp = $wp_query;
                    $wp_query = null;
                    $wp_query = new WP_Query();
                    $wp_query->query('post_type=movies' . '&paged=' . $paged . '&posts_per_page=6');
                    
                    while ( $wp_query->have_posts() ) : $wp_query->the_post(); $c++;


                 << LOOP GOES HERE >>

                <?php
                    endwhile; 
                    my_paginate_links();
                    $wp_query = null;
                    $wp_query = $temp;
                    wp_reset_query();
                ?>
                    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
                    $movie_query = new WP_Query( array(
                        'post_type' => 'movies',
                        'paged' => $paged,
                        'posts_per_page' => 6
                    ));
                    
                    if($movie_query->have_posts()){
                        while ( $movie_query->have_posts() ) {
                            $movie_query->the_post();
                    $c=0;
                    $i=1;
                    
                    $temp = $wp_query;
                    $wp_query = null;
                    $wp_query = new WP_Query();
                    $wp_query->query('post_type=movies' . '&paged=' . $paged . '&posts_per_page=6');
                    
                    while ( $wp_query->have_posts() ) : $wp_query->the_post(); $c++;
                    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
                    $loop = new WP_Query( array(
                        'post_type' => 'movies',
                        'paged' => $paged,
                        'posts_per_page' => 6
                    ));
                    
                    if($loop->have_posts()){
                        while ( $loop->have_posts() ) {
                            $loop->the_post();

                            << LOOP GOES HERE >>


                   <?php
                      }
                   }
                   my_paginate_links();
                   wp_reset_postdata();
                   ?>
                    $c=0;
                    $i=1;
                    
                    $temp = $wp_query;
                    $wp_query = null;
                    $wp_query = new WP_Query();
                    $wp_query->query('post_type=movies' . '&paged=' . $paged . '&posts_per_page=6');
                    
                    while ( $wp_query->have_posts() ) : $wp_query->the_post(); $c++;


                 << LOOP GOES HERE >>

                <?php
                    endwhile; 
                    my_paginate_links();
                    $wp_query = null;
                    $wp_query = $temp;
                    wp_reset_query();
                ?>
Source Link
Desi
  • 1.2k
  • 4
  • 37
  • 54
Loading