Php 在带有分页的自定义页面模板上显示帖子图像

Php 在带有分页的自定义页面模板上显示帖子图像,php,jquery,wordpress,pagination,Php,Jquery,Wordpress,Pagination,我的页面模板有这个代码 这就是我现在拥有的: 我如何更改它,以便它可以以每页20个图像的速度显示我的所有帖子图像,并在下面分页 <?php /* Template Name: emoticons-page */ get_header(); ?> <div id="content"> <div id="main"> <?php query_posts('cat=44'.get_the_title().'&post_status=publish,f

我的页面模板有这个代码

这就是我现在拥有的:

我如何更改它,以便它可以以每页20个图像的速度显示我的所有帖子图像,并在下面分页

<?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(); ?>





您可以使用
'posts\u per\u page'=>20
作为替代,您可以使用此插件。
<?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>