Support » Themes and Templates » custom post type page template pagination

  • Resolved Khashayarp

    (@khashayarp)


    I am trying to make a page template for the latest custom post types and it shows the recent 10 posts but i want to add a pagination at the end of it!
    it is not the archive page it is a custom page template.

    <?php
    global $wp_query;
    
    $wp_query = new WP_Query("post_type=questions&post_status=publish&posts_per_page=10");
    if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <div style="margin:10px;padding:5px;border-bottom:1px dashed #ebebeb;height:auto;">
    <div style="float:right;width:60px;margin-left:10px;" class="questions-page-2">
    <?php echo get_avatar( get_the_author_email(), '48' ); ?>
    </div>
    <div style="float:left;width:450px;" class="questions-page-1">
    <h6 class="toggle"><a href="#" style="opacity: 1;"><?php the_title(); ?></a></h6>
    
    <div class="toggle_content" style="display: block;">
    <div class="block"><?php $content = get_the_excerpt();
    echo substr($content, 0, 120); ?> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">... show question</a>
    </div>
    
    </div>
    </div>
    <div class="clearboth"></div>
    </div>
    <?php endwhile;
    endif; ?>

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘custom post type page template pagination’ is closed to new replies.