Quantcast
Channel: WordPress | サポートフォーラム »投稿一覧
Viewing all articles
Browse latest Browse all 1305

タクソノミー一覧ページで日付順ソートボタンが効かない

$
0
0
<ul>
<li><a href="<?php echo add_query_arg( array('sort' => 'date', 'order' => 'DESC') ); ?>">投稿が新しい順</a></li>
<li><a href="<?php echo add_query_arg( array('sort' => 'date', 'order' => 'ASC') ); ?>">投稿が古い順</a></li>
</ul>

	<ul>
		<?php
		$type = get_query_var( "news-cat" );
		$args = array(
			"post_type" => array( "news" ),
			"tax_query" => array(
				"relation" => "OR",
				array(
					"taxonomy" => "news-cat",
					"field" => "slug",
					"terms" => $type,
				),
			),
			"paged" => $paged,
			"posts_per_page" => "-1"
		);
		$the_query = new WP_Query( $args );
		if ( $the_query->have_posts() ): ?>
		<?php while ($the_query->have_posts()): $the_query->the_post(); ?>
		<li> ~ </li>
		<?php endwhile; ?>
		<?php wp_reset_postdata(); ?>
		</ul>

上記ソースで、タクソノミー一覧ページで日付順ソートボタンを設置したいのですが、ソートボタンが効きません。

記事一覧に影響を及ぼすプラグインも仕様していません。

どなたか同じような現象をご存じでしょうか?

ご教授頂けると助かります。


Viewing all articles
Browse latest Browse all 1305

Trending Articles