【发布时间】:2020-11-10 03:33:59
【问题描述】:
我现在加载一个类别的子页面帖子,现在我尝试按他的子类别过滤此帖子,并在单击按钮后获取指向 mypage.com/subpage/?slug=fish 之类的页面的链接,仅查看鱼帖子。
我应该使用 $_GET 吗?
有人可以帮忙吗?
有我的代码从动物类别中加载我的所有帖子
<?php
$args = array(
'cat' => 50,
'posts_per_page' => '999',
'order' => 'ASC',
'orderby' => 'menu_order',
);
$the_query = new WP_Query($args);
// The Loop
if ($the_query->have_posts()) {
?>
<?php
while ($the_query->have_posts()) {
$the_query->the_post();
get_template_part( 'templates/content/content', 'animals' );
}
/* Restore original Post Data */
wp_reset_postdata();
} else {
// no posts found
echo '';
}
?>
【问题讨论】:
标签: php html jquery wordpress filter