Support » Fixing WordPress » Display post from one category – Pagination

  • Hanz17


    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

    Template Name: Hry
    	$gazpo_settings = get_option( 'gazpo_options');
    query_posts('posts_per_page=7&paged=' . $paged);
    <div id="wrap" class="wide-content">		<div class="entry">						
    <div class="posts-list">
    	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>
    						</div> <!-- /post-meta -->
    						<div class="entry">
    							if ( $gazpo_settings['gazpo_read_more'] != ''){
    								$readmore_text= $gazpo_settings['gazpo_read_more'];
    							} else {
    								$readmore_text= 'Read more &rarr;';
    						</div> <!-- entry -->
    					</div><!-- /post-->
    </div> <!-- entry --> 
    	</div><!-- /content -->
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
    <div id="pagination">
    			<?php echo gazpo_pagination(); ?>

    Link on page:

Viewing 3 replies - 1 through 3 (of 3 total)
  • xmatter


    I have used a page template for this:

    /* Template Name: Single Category */
    <?php get_header(); ?>
    <?php get_sidebar(); ?>
    <div id="content">
    	if (have_posts()) : while (have_posts()) : the_post(); ?>
    			<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    			<?php the_meta(); ?>
    			<!--<?php the_post_thumbnail(); ?>-->
    	<?php endwhile; endif; ?>	
    	<?php wp_reset_query(); ?>
    </div><!-- end content -->
    <?php get_footer(); ?>

    change the cat13 to whatever your cat to be displayed is. Then you must change the PAGE to this page template.



    Ok thanks but I need pagination too. I haven´t idea, how :D. I want only 7 posts on page, next 7 posts will be on second page, etc.




    the pagination code would likely go just after the endwhile of the loop;

    for how to integrate that into your theme, please contact the theme’s developer for support.

    this forum only supports themes from

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Display post from one category – Pagination’ is closed to new replies.