Reply To: Creating archive page

Home Forums Support Creating archive page Reply To: Creating archive page

Home Forums Support Creating archive page Reply To: Creating archive page

#149150
Mathijs Kooij

Thank you. I created a child theme (for some other options also).

Made a new page-archive.php in this and based it on page.php. It works now (code is below), but styling is all wrong, not enough experience. Could you look into it and see what goes wrong? The page I use it for is:
https://bestevaer.org/nieuws/archief/

<?php
/*
Template Name: Archives
*/
get_header(); ?>

>
<main id=”main” <?php generate_main_class(); ?>>
<?php do_action(‘generate_before_main_content’); ?>

<?php the_post(); ?>

<?php get_search_form(); ?>

<h2>Archieven per maand:</h2>

    <?php wp_get_archives(‘type=monthly’); ?>

<h2>Archieven per onderwerp:</h2>

    <?php wp_list_categories(); ?>

<h2>Archieven per Auteur:</h2>

    <?php wp_list_authors(‘show_fullname=1&optioncount=1&orderby=post_count’); ?>

<h2>Alle pagina’s:</h2>

    <?php wp_list_pages(‘title_li=’); ?>

<!– #content –>

<!– #container –>

<?php while ( have_posts() ) : the_post(); ?>

<?php get_template_part( ‘content’, ‘page’ ); ?>

<?php
// If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || ‘0’ != get_comments_number() ) : ?>

<?php comments_template(); ?>

<?php endif; ?>

<?php endwhile; // end of the loop. ?>
<?php do_action(‘generate_after_main_content’); ?>
</main><!– #main –>

<!– #primary –>

<?php
do_action(‘generate_sidebars’);
get_footer();