Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/232.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 具有多个WP_查询循环的分页自定义帖子类型_Php_Pagination_Wordpress - Fatal编程技术网

Php 具有多个WP_查询循环的分页自定义帖子类型

Php 具有多个WP_查询循环的分页自定义帖子类型,php,pagination,wordpress,Php,Pagination,Wordpress,将分页功能添加到Functions.php并在模板产品列表.php中调用后 结果中没有显示任何内容。 我有个大问题 你能找到并解决这个问题吗 thnx 如果您确定有一种称为“产品”的帖子类型,并且其中有帖子 尝试: 我认为你必须更具体地说明你尝试了什么,看到了什么。没有人会有时间重新创建您的案例并为您调试(至少没有人您不付费)。谢谢亲爱的。但我复制了孔文件,以便更详细!也许你是对的。这是我在这里的第一个问题,我是初学者…谢谢你的回答。但一切都没有改变。 <articl

将分页功能添加到Functions.php并在模板产品列表.php中调用后 结果中没有显示任何内容。 我有个大问题

你能找到并解决这个问题吗

thnx



如果您确定有一种称为“产品”的帖子类型,并且其中有帖子

尝试:



我认为你必须更具体地说明你尝试了什么,看到了什么。没有人会有时间重新创建您的案例并为您调试(至少没有人您不付费)。谢谢亲爱的。但我复制了孔文件,以便更详细!也许你是对的。这是我在这里的第一个问题,我是初学者…谢谢你的回答。但一切都没有改变。
        <article class="row">

            <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

            <div id="single-head" class="sixteen columns">
                <h1><?php the_title(); ?></h1>
                <?php if (has_excerpt()) { the_excerpt(); } ?>
            </div>

            <div class="row">
                <nav id="portfolio-filters" class="sixteen columns">
                    <a href="#filter" class="active-item" data-filter="*"><?php _e('Show All', 'ci_theme'); ?></a>
                    <?php
                    $args = array(
                        'hide_empty' => 0
                    );

                    $skills = get_terms('product-category', $args);
                    ?>
                    <?php foreach ( $skills as $skill ) : ?>
                        <a href="#filter" data-filter=".<?php echo $skill->slug; ?>"><?php echo $skill->name; ?></a>
                    <?php endforeach; ?>
                </nav><!-- /portfolio-filters -->
            </div>

            <div id="portfolio-items" class="row">
                <?php $ci_product_query = new WP_Query('post_type=product&posts_per_page=4'); ?>
                <?php if ( $ci_product_query-> have_posts() ) : while ( $ci_product_query->have_posts() ) : $ci_product_query->the_post(); ?>
                <?php $item_skills = wp_get_object_terms($post->ID, 'product-category');    ?>

                <article class="<?php ci_e_setting('product_columns'); ?> columns <?php foreach ( $item_skills as $item_skill ) : echo $item_skill->slug.' '; endforeach; ?> columns portfolio-item">

                    <a href="<?php echo get_permalink(); ?>" title="<?php echo esc_attr(get_the_title()); ?>" class="fb">
                        <?php the_post_thumbnail('ci_portfolio_slider', array('class'=>'scale-with-grid')); ?>
                    </a>
                    <div class="portfolio-desc">
                        <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
                        <p class="desc"><?php echo mb_substr(get_the_excerpt(), 0, 70); ?>...</p>
                    </div>
                </article><!-- /portfolio-item -->

                <?php endwhile; endif; ?>
                <?php wp_reset_postdata(); ?>

            </div><!-- /portfolio-items -->

            <?php get_template_part('part', 'call_to_action'); ?>

            <?php endwhile; endif; ?>
        <div class="pagination">
        <?php wp_pagination(); ?>
        </div>
        </article>
 <div id="portfolio-items" class="row">
            <?php $ci_product_query = new WP_Query(array('post_type'=>'product', 'posts_per_page'=> 4); ?>
            <?php if ( $ci_product_query-> have_posts() ) : while ( $ci_product_query->have_posts() ) : $ci_product_query->the_post(); ?>