Paginate_links in custom post type template

I’m trying to display the paginate_links function within a custom post type. But it does not show up on the site. Here is the loop:

<div class="container">
    <?php
        $objekte_args = array(
            'post_type' => 'objekte',
            'posts_per_page' => '1'
         )
     ?>
        <?php $objekte = new WP_Query( $objekte_args ); ?>
        <?php if ( $objekte->have_posts() ) : ?>
        <?php while ( $objekte->have_posts() ) : $objekte->the_post(); ?>
        <div class="row">
            <div class="col-md-push-1 col-md-4">
                <h2>
                    <?php _e( 'Objekte', 'ryvola' ); ?>
                </h2>
                <div class="projects__project-title">
                    <span class="projects__project-title--headline"><?php the_title(); ?></span>
                    <?php the_content(); ?>
                </div>
                <?php echo paginate_links( array(
                    'format' => '?paged=%#%'
                )); ?>
            </div>
        </div>
        <?php endwhile; ?>
        <?php wp_reset_postdata(); ?>
        <?php else : ?>
        <p>
            <?php _e( 'default', 'ryvola' ); ?>
        </p>
        <?php endif; ?>
</div>

What am I doing wrong?

Read more here: Paginate_links in custom post type template

Leave a Reply

Your email address will not be published. Required fields are marked *