Thread Starter
KylcMc
(@kylcmc)
After more googling and lots of reading I’ve got a start I think. I’ve started by modifying index.php to make a call to a new loop file for the archive and duplicating loop-blog.php to loop-archive.php. So far that is working as I’ve made a few test changes to my new file (loop-archive.php) to see if it is being called.
Now I’m stuck at page formatting. I want the output to look similar to a page with just a list of the post titles, date, author.
Updated excerpt from index.php
<!-- Start the Loop -->
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php if ( is_category() || is_tag() || is_date() ) : ?>
<?php get_template_part( 'loop', 'archive' ); ?>
<?php elseif ( !is_singular() ) : ?>
<?php get_template_part( 'loop', 'blog' ); ?>
<?php else : ?>
<?php get_template_part( 'loop', 'single' ); ?>
<?php endif; ?>
<?php endwhile; else: ?>
You shouldn’t edit the theme files without using a child theme. You know what happens if you don’t use one, right?
To achieve what you’re after, you could just copy index.php to your child theme folder then rename it as archive.php.
Then change the loop to something like this:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class('blog-view'); ?>>
<header class="entry-header cf">
<h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php echo the_title(); ?></a></h2>
<div class="entry-date"><?php the_time(get_option('date_format')); ?></div>
<div class="entry-author"><?php the_author_posts_link(); ?></div>
</header>
</article>
<?php endwhile; else: ?>
Thread Starter
KylcMc
(@kylcmc)
No I don’t, but I can only assume resulting in something unfavorable. So I shall look at the child theme direction then. Thanks for the loop suggestion I’ll try that out after I remove the files I edited, upload the originals, and research the child theme direction.