962 posts
  • Has been part of the Envato Community for over 5 years
  • Has sold $10,000+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
EireStudio says

Hey Guys,

I am pulling two custom post types into a loop and having a hard time getting the pagination to show, what am I doing wrong? :(


<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
                $args = array
                (
                    'post_type' ?> array('bingo_reviews', 'new_bingo_sites'),
                    'posts_per_page' => 1,
                    'paged' => $paged,
                    'caller_get_posts'=> 1
                );
                $custom_query = new WP_Query($args);
                while($custom_query->have_posts()) : $custom_query->the_post(); ?>

                    <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
                    <?php the_excerpt_rereloaded('45','More','','div','yes'); ?>

                <?php endwhile; ?>
                <?php wp_reset_postdata(); // reset the query ?>

                <div style="padding: 12px 0px">
                    <?php wp_pagenavi(); ?>
                </div>

147 posts
  • Has been part of the Envato Community for over 3 years
  • Has referred 10+ members
  • Has sold $250,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+2 more
FlexiPress says

try this

<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
                $args = array
                (
                    'post_type' ?> array('bingo_reviews', 'new_bingo_sites'),
                    'posts_per_page' => 1,
                    'paged' => $paged,
                    'ignore_sticky_posts'=> 1
                );
                query_posts($args);
                if (have_posts()) :
                while(have_posts()) : the_post(); ?>
                    <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
                    <?php the_excerpt_rereloaded('45','More','','div','yes'); ?>
                <?php endwhile; ?>
                    <?php wp_pagenavi(); ?>
                <?php endif; ?>
                <?php wp_reset_query(); ?>
962 posts
  • Has been part of the Envato Community for over 5 years
  • Has sold $10,000+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
EireStudio says

Thanks man, but no go unfortunately :(

http://www.freenodepositbingo.co.uk/bingo-reviews/page/2/
PrimaThemes said
try this
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
                $args = array
                (
                    'post_type' ?> array('bingo_reviews', 'new_bingo_sites'),
                    'posts_per_page' => 1,
                    'paged' => $paged,
                    'ignore_sticky_posts'=> 1
                );
                query_posts($args);
                if (have_posts()) :
                while(have_posts()) : the_post(); ?>
                    

<?php the_title(); ?>

<?php the_excerpt_rereloaded(‘45’,’More’,’’,’div’,’yes’); ?> <?php endwhile; ?> <?php wp_pagenavi(); ?> <?php endif; ?> <?php wp_reset_query(); ?>
3243 posts
  • Has sold $5,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Located in United States
  • Has been part of the Envato Community for over 4 years
+1 more
organicbee says
962 posts
  • Has been part of the Envato Community for over 5 years
  • Has sold $10,000+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
EireStudio says
3243 posts
  • Has sold $5,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Located in United States
  • Has been part of the Envato Community for over 4 years
+1 more
organicbee says
RedHenry said
OrganicBeeMedia said
http://themeforest.net/forums/thread/custom-post-types-pagination-and-404-not-found-pages/32264 http://themeforest.net/forums/thread/custom-post-types-and-permalinks-in-wordpress-31-rc/39380 theres a few more threads on it also
Thanks man, I don’t have any pages created at all though :(

how are you registering the custom post types? and what is your permalink structure

962 posts
  • Has been part of the Envato Community for over 5 years
  • Has sold $10,000+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
EireStudio says
OrganicBeeMedia said
RedHenry said
OrganicBeeMedia said
http://themeforest.net/forums/thread/custom-post-types-pagination-and-404-not-found-pages/32264 http://themeforest.net/forums/thread/custom-post-types-and-permalinks-in-wordpress-31-rc/39380 theres a few more threads on it also
Thanks man, I don’t have any pages created at all though :(
how are you registering the custom post types? and what is your permalink structure

Through my functions.php file. I have made a template also called archive-bingo_reviews.php and my permalink structure is just / postname /

3243 posts
  • Has sold $5,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Located in United States
  • Has been part of the Envato Community for over 4 years
+1 more
organicbee says
RedHenry said
OrganicBeeMedia said
RedHenry said
OrganicBeeMedia said
http://themeforest.net/forums/thread/custom-post-types-pagination-and-404-not-found-pages/32264 http://themeforest.net/forums/thread/custom-post-types-and-permalinks-in-wordpress-31-rc/39380 theres a few more threads on it also
Thanks man, I don’t have any pages created at all though :(
how are you registering the custom post types? and what is your permalink structure
Through my functions.php file. I have made a template also called archive-bingo_reviews.php and my permalink structure is just / postname /
try adding something like the rewrite to your register_post_type(if you dont have it already)
register_post_type( 'archive_bingo_revoew',
        array(
                    'rewrite' => array('slug' => 'bingo-review')
            )
);
447 posts Don't be a HATER!
  • Has referred 10+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+5 more
webinpixels says

do you still use wp_reset_postdata(); in your loop?

try to move it after wp_pagenavi();

good luck :)

by
by
by
by
by
by