I'm very new to PHP and have some trouble wrapping my head around it sometimes so please bear with me.
I have a lot of categories and a lot of tags. I started making category-slug.php templates but it'd probably be best for me to just use category.php and tag.php templates. I just can't get them to work unless I add in something like 'category_name' => 'art'
. I've also read that querying isn't ideal (I think that's what I'm doing?), but I have had custom development done and I'm not sure if that has or hasn't been left as my only option.
$page_content = "";
if (have_posts()) :
while (have_posts()) : the_post();
$page_content .= get_the_content();
endwhile;
endif;
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array( 'post_type' => 'post', 'posts_per_page' => 6, 'paged'
=> $paged );
And then later on I have this with post title, date, excerpts, etc. to follow.
<?php
$wp_query = new WP_Query($args);
while ( $wp_query->have_posts() ) : $wp_query->the_post();
?>
How do I make the category.php and tag.php pages specific to each unique slug without having to manually make each one?