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">
        $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">
                    <?php _e( 'Objekte', 'ryvola' ); ?>
                <div class="projects__project-title">
                    <span class="projects__project-title--headline"><?php the_title(); ?></span>
                    <?php the_content(); ?>
                <?php echo paginate_links( array(
                    'format' => '?paged=%#%'
                )); ?>
        <?php endwhile; ?>
        <?php wp_reset_postdata(); ?>
        <?php else : ?>
            <?php _e( 'default', 'ryvola' ); ?>
        <?php endif; ?>

What am I doing wrong?

Read more here: Paginate_links in custom post type template


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: