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:

  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?

本文标签: wp queryNew template file does not load categoryspecific post