0

I have this code for my page template.

This is what i have right now: http://www.ohright.com/emoticons/

How do I change it so that it can display all my post images at 20 images per-page and with a pagination below?

<?php
/*
Template Name: emoticons-page
*/
get_header(); ?>

<div id="content">
<div id="main">
<?php query_posts('cat=44'.get_the_title().'&post_status=publish,future');?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
<p><?php the_content(); ?>
<?php endwhile; else: endif; ?>
</div>
</div>

<?php get_footer(); ?>
1

1 Answer 1

2
<?php
/*
Template Name: emoticons-page
*/
get_header(); ?>
<div id="content">
    <div id="main">
        <?php 
        $paged = (get_query_var('page')) ? get_query_var('page') : 1;
        $posts_per_page = 20;
        query_posts('cat=44&post_status=publish&paged=' . $paged . '&posts_per_page=' . $posts_per_page);?>
        <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
            <h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
            <p><?php the_content(); ?>
        <?php endwhile; 
        posts_nav_link();
        wp_reset_query();
        endif; ?>
    </div>
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.