admin管理员组文章数量:1391995
I have 2 Files:
index.php
newStuff.php
I want to get all posts with one specific category with this Code:
$args = array(
'posts_per_page' => 1000000000,
'cat' => '',
'paged' => get_query_var('paged'),
);
$q = new WP_Query($args);
if ( $q->have_posts() ) {
while ( $q->have_posts() ) {
$q->the_post();
if (get_the_category( $id )[0]->name == "Sportprojekte") {
}
}
}
Questions:
I duplicated
index.php
into newnewStuff.php
, but the new file generates all posts.Why does CSS stylesheet not showing up in the head?
本文标签: wp queryNew template file does not load categoryspecific post
版权声明:本文标题:wp query - New template file does not load category-specific post 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744634779a2616759.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论