I'm working on an addition to my Wordpress Theme and I have a problem:
- Theres the "/" which displays all of my posts excluding posts with the category "photos"
- Then there's "/category/photos" for which I created the file "category-photos.php", since the theme styles everything with archive.php
Now what I need is: the category page should look the same as the homepage (same styling, same displaying of posts) and I just have no idea how to accomplish this. Is there a simple way I can achieve this?
Normally I just read here, but I can't seem to solve this problem on my own, that's why I created an account.
Here's what the category-photos.php looks like right now (copied this from archive.php)
<?php get_header(); ?> <div id="primary" class="content-area"> <main id="main" class="site-main" role="main"> <?php if ( have_posts() ) : ?> <header class="page-header"> <?php the_archive_title( '<h1 class="page-title">', '</h1>' ); the_archive_description( '<div class="page-description">', '</div>' ); ?> </header><!-- .page-header --> <?php /* Start the Loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php /* Include the Post-Format-specific template for the content. * If you want to override this in a child theme, then include a file * called content-___.php (where ___ is the Post Format name) and that will be used instead. */ get_template_part( 'content-archive', get_post_format() ); ?> <?php endwhile; ?> <?php the_posts_navigation(); ?> <?php else : ?> <?php get_template_part( 'content', 'none' ); ?> <?php endif; ?> </main><!-- #main --> </div><!-- #primary -->