【问题标题】:Page_navi plugin create but its not workingPage_navi 插件创建但它不工作
【发布时间】:2021-01-13 01:05:43
【问题描述】:

page / 2 / 正在运行,但主页总是出现帮助

        <div class="row">

            <div class="col-md-8">

            <?php $query = new WP_Query('post_type=homee');?>
            

            <?php if ( $query->have_posts() ) : while ($query->have_posts() ) : $query->the_post();?>
             
            <div class="card mt-4">

                    <a href="<?php the_field('homecard-link');?>" class='card-header-h'><h3 

class="card-title m-2">

                    <div class="card-footer text-muted ">

                        <i class="fas fa-table text-warning"></i>

                        Post Tarihi <?php the_field('homepost-history');?>
                    </div>

                    <a href="<?php the_field('homecard-link');?>"><img src="<?php 

the_field('homeimage');?>" class="card-img-top img-thumbnail">

                    <div class="card-body">

                        <p class="card-text"><?php the_field('homecard-text');?></p>

                        <a class="more" href="<?php the_field('homecard-link');?>"><button 

type="button" class="btn btn-dark more"> Devamını Oku

                </div>
                
                <?php endwhile; ?>

                 <?php else : ?>

                   <p><?php esc_html_e( 'Üzgünüz, Sayfa Bulunamadı' ); ?></p>

               <?php endif; 

                wp_pagenavi(array( 'query' => $query )); `this problem`

                wp_reset_query(); `this problem`

                ;?>
               

【问题讨论】:

    标签: php html wordpress wordpress-theming wordpress-gutenberg


    【解决方案1】:

    请尝试替换 wp 查询

    <?php $query = new WP_Query('post_type=homee', 'paged' => get_query_var( 'paged' ));?>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-11-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-26
      • 2015-05-24
      • 1970-01-01
      相关资源
      最近更新 更多