Display post from one category – Pagination
-
Hi,
I wanted on page only the posts from one category. That is what I want, but I do not know how to do pagination. I tried the instructions and or plugin, but nothing works. I want on one page previewed 7 posts and then it was pagination. Thanks for the advice ??I attach the code without pagination. And code pagination in template
<?php /* Template Name: Hry */ get_header(); $gazpo_settings = get_option( 'gazpo_options'); ?> <?php query_posts('posts_per_page=7&paged=' . $paged); ?> <div id="wrap" class="wide-content"> <div class="entry"> <div class="posts-list"> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div id="post-<?php the_ID(); ?>" <?php post_class($classes); ?>> <h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2> <div class="post-meta"> <span class="info"> <span class="date"><?php the_time('M. d') ?></span> <span class="category"><?php the_category(', ' ); ?></span> <span class="comments"><?php comments_popup_link( __('no comments', 'silverorchid'), __( '1 comment', 'silverorchid'), __('% comments', 'silverorchid')); ?></span> </span> </div> <!-- /post-meta --> <div class="entry"> <?php if ( $gazpo_settings['gazpo_read_more'] != ''){ $readmore_text= $gazpo_settings['gazpo_read_more']; } else { $readmore_text= 'Read more →'; } the_content($readmore_text); ?> </div> <!-- entry --> </div><!-- /post--> <?php endwhile; endif; wp_reset_query(); ?> </div> </div> <!-- entry --> </div><!-- /content --> <?php get_sidebar(); ?> <?php get_footer(); ?>
<div id="pagination"> <?php echo gazpo_pagination(); ?> </div>
Link on page:
https://zoomon.cz/hry/
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Display post from one category – Pagination’ is closed to new replies.