サポート » 使い方全般 » ページネーションが一度表示されるが、すぐに消えてしまう。

  • 解決済 morimorinao

    (@morimorinao)


    <?php get_header(); ?><section id="NEWS" class="cf defWidth pt40"><?  ?><section class="newsListWrap"><?php if ( have_posts() ): ?><ul class="newsList<?php if($paged < 2): ?> newsList_page1<?php else: ?> newsList_pagex<?php endif; ?> cf"><?php while ( have_posts() ) : the_post();$thumb_id = get_post_thumbnail_id();$img = wp_get_attachment_image_src($thumb_id, 'full');$cat = get_the_category();$cat = $cat[0];?><li><a>"><div class="imgWrap"><div class="imgWrap_inner" style="background-image: url(<?php echo $img[0] ?>)"><b><?php echo get_cat_name($cat->term_id); ?></b><span><?php the_title() ?><time><?php the_time("Y.n.j"); ?></time></span></div></div><time><?php the_time("Y.n.j"); ?></time><h2><?php the_title() ?></h2><p><?php the_field('description') ?></p></a></li><?php endwhile; ?></ul><?php endif; ?></section><aside><div id="pickupPostArea"><h3>ピックアップ</h3><ul class="relatedPostList cf"><?php $args = array('post_type' => 'news','posts_per_page' => 3,'tag' => 'pickup',);$query = new WP_Query($args);if ($query->have_posts()): while($query->have_posts()): $query->the_post();$thumb_id = get_post_thumbnail_id();$img = wp_get_attachment_image_src($thumb_id, 'full');?><li><a>"><div class="imgWrap"><div class="imgWrap_inner" style="background-image: url(<?php echo $img[0] ?>)"><span><?php the_title() ?></span></div></div><h2><?php the_title() ?></h2></a></li><?php endwhile; endif; wp_reset_postdata(); ?></ul></div><div class="popularPostArea"><h3>人気記事</h3><ul class="relatedPostList"><?php $args = array('post_type' => 'news','posts_per_page' => 6,'orderby' => 'rand',);$query = new WP_Query($args);if ($query->have_posts()): while($query->have_posts()): $query->the_post();$thumb_id = get_post_thumbnail_id();$img = wp_get_attachment_image_src($thumb_id, 'full');?><li><a>"><div class="imgWrap"><div class="imgWrap_inner" style="background-image: url(<?php echo $img[0] ?>)"><span><?php the_title() ?></span></div></div><h2><?php the_title() ?></h2></a></li><?php endwhile; endif; wp_reset_postdata(); ?></ul></div></aside></section><div class="pager mt20 mb80"><?php the_posts_pagination( array('prev_text' => __('<< PREV'),'next_text' => __('NEXT >>'),'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( '') . ' </span>','screen_reader_text' => __(' '),) );?></div><?php get_footer(); ?>

    • このトピックは6年、 4ヶ月前にTakayuki Miyoshiが編集しました。理由: 不適切なコード引用

    ヘルプの必要なページ: [リンクを見るにはログイン]

3件の返信を表示中 - 1 - 3件目 (全3件中)
  • トピック投稿者 morimorinao

    (@morimorinao)

    Wordpress初心者です。追記です。

    最後のニュースのページだけは、ページネーションが消えずに正常にうまくいきます。
    http://led.led-tokyo.co.jp/news/page/12/

    PBD AJAX Load Posts というプラグインが、テーマの元々のページナビゲーションを消して別のナビゲーションに置換しようとしているようなので、PBD AJAX Load Posts プラグインを停止すれば、とりあえず最終ページと同じナビゲーションが消えないようにはなると思います。

    トピック投稿者 morimorinao

    (@morimorinao)

    解決しました。
    ありがとうございます。
    とても助かりました。
    また、何かありましたらよろしくお願いいたします。

3件の返信を表示中 - 1 - 3件目 (全3件中)
  • トピック「ページネーションが一度表示されるが、すぐに消えてしまう。」には新たに返信することはできません。