dongwuying0221 2014-09-24 10:55 采纳率: 0%
浏览 54
已采纳

分类页面中的分页问题[WordPress]

I wanted to show one category posts from all custom post types, which my code does very well but pagination just stopped working. here is my code:

<div class="col-md-9 exerpts-wrap">
    <div class="row">
        <?php
        $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
        query_posts(array(
            'post_type' => array('post', 'resources', 'products'),
            'category__in' => array(3)
        ));

        while (have_posts()) : the_post(); ?>
            <div class="col-sm-6">
                <div class="blog-sec">

                    <?php get_template_part('content', get_post_format()); ?>

                </div> <!-- blog-sec ends here -->

            <?php endwhile; ?>

        </div> <!-- col-sm-6 ends here -->

        <?php pagination_numeric_posts_nav(); ?>
    </div> <!-- exerpts-wrap fix ends here -->

Any suggestion would be greatly appreciated.

  • 写回答

1条回答 默认 最新

  • duandou2763 2014-10-02 23:07
    关注

    I been looking for a solution of this issue since long time and now i got a solution for this. I am answering my own question so it helps someone else who are facing same issue.

    All i did to fix this issue is to install a plugin called "Cat Post Type" and nothing else, everything works great now.

    I knew my code wasn't wrong. Plugin doesn't add anything visually in admin section, it just add some code which fixes this issue.

    Goodluck!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序