New template file does not load category-specific post
Question
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?
0
loop, wp-query
4 years
2020-03-26T08:50:58-05:00
2020-03-26T08:50:58-05:00 0 Answers
108 views
0
Leave an answer