最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

wp query - New template file does not load category-specific post

programmeradmin2浏览0评论

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:

  1. I duplicated index.php into new newStuff.php, but the new file generates all posts.

  2. Why does CSS stylesheet not showing up in the head?

发布评论

评论列表(0)

  1. 暂无评论