regulus-design
フォーラムへの返信
6件の返信を表示中 - 1 - 6件目 (全6件中)
-
フォーラム: 使い方全般
返信が含まれるトピック: 投稿を先頭に固定表示すると下の記事一覧にも同じ記事が表示されてしま時間が掛かってしまいましたが、
アドバイスを基に解決いたしました。<div class="row"> <?php $myquery_pickup = array( 'posts_per_page' => 1, 'ignore_sticky_posts' => 1, 'post__in' => get_option('sticky_posts') ); ?> <?php query_posts($myquery_pickup); ?> <?php if(have_posts()): while(have_posts()): the_post(); ?> <?php get_template_part('content','pickup'); ?> <?php endwhile; endif; ?> </div> <div class="row"> <?php $myquery_recent01 = array( 'posts_per_page' => 2, 'ignore_sticky_posts' => 1, 'post__not_in' => get_option('sticky_posts'), 'tax_query' => array(array( 'taxonomy' => 'post_format', 'field' => 'slug', 'terms' => 'post-format-status', 'operator' => 'NOT IN' )) ); ?> <?php query_posts($myquery_recent01); ?> <?php if(have_posts()): while(have_posts()): the_post(); ?> <?php get_template_part('content','main'); ?> <?php endwhile; endif; ?> </div> <div class="row"> <?php $myquery_recent02 = array( 'posts_per_page' => 8, 'offset' => 2, 'ignore_sticky_posts' => 1, 'post__not_in' => get_option('sticky_posts'), 'tax_query' => array(array( 'taxonomy' => 'post_format', 'field' => 'slug', 'terms' => 'post-format-status', 'operator' => 'NOT IN' )) ); ?> <?php query_posts($myquery_recent02 . '&cat=-55'); ?> <?php if(have_posts()): while(have_posts()): the_post(); ?> <?php get_template_part('content','newslist'); ?> <?php endwhile; endif; ?> </div>
あまり綺麗なコードではないかもしれませんが、
思うように動き、大変助かりました。どうもありがとうございました。フォーラム: 使い方全般
返信が含まれるトピック: 投稿を先頭に固定表示すると下の記事一覧にも同じ記事が表示されてしまお二人ともご指導ありがとうございます。
ignore_sticky_posts をはずしたところ、
大見出し:最新記事2件
小見出し:最新記事3〜8件
の両方の1番上に先頭に指定した記事が来てしまいました。フォーラム: 使い方全般
返信が含まれるトピック: 投稿を先頭に固定表示すると下の記事一覧にも同じ記事が表示されてしまご指導ありがとうございます。
<?php endwhile; ?><?php wp_reset_query(); ?><?php endif; ?>
こういうことでしょうか?
また、endwhileが3カ所ありますが、3カ所全てに記入するのでしょうか。
大変恐縮ですが、教えていただけますれば幸いです。フォーラム: 使い方全般
返信が含まれるトピック: カスタムフィールドのインポートプラグインによって解決いたしました。
ありがとうございました。フォーラム: 使い方全般
返信が含まれるトピック: previous_posts_linkが出ません。現在、WP page naviというプラグインを入れ、2ページ目以降もページ送りができるようになりました。
<div class="culumn_area"> <ul id="lower_news_list"> <?php query_posts($query_string . "&posts_per_page=3"); ?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <li> <dl class="clearfix"> <dt> <?php the_time('Y.m.d'); ?></dt> <dd> <a href="<?php the_permalink(); ?>"><?php the_title();?></a></dd> </dl> </li> <?php endwhile; else: ?> <?php _e('Sorry, no posts matched your criteria.'); ?> <?php endif; ?> <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?> </ul> </div>
ページナビゲーションの数字から各ページに移動できるようになりましたが、<<prev pageのみ表示されません。そんなに問題はありませんが、このコードが間違っているからだと思います。
もし、間違いをご指摘してくださる方がいらっしゃいましたら、よろしくお願いします。フォーラム: 使い方全般
返信が含まれるトピック: previous_posts_linkが出ません。早速のご返信ありがとうございます。
試してみましたが、動きませんでした。
…うーん…難しいですね。
6件の返信を表示中 - 1 - 6件目 (全6件中)