0

This is my template for archive.php template:

    <?php /* Template Name: Archives */ ?>
<?php include 'head.php' ?>

<body>
    <?php include 'header-page.php' ?>
    <main class="main_index">
        <section class="posts">
            <div class="center">
                <div>
                    <h2>
                        <?php single_cat_title(); ?>
                    </h2>
                </div>
                <div>
                    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
                    <div class="post">
                        <a href="<?php the_permalink(); ?>">
                            <h3>
                                <?php the_title(); ?>
                            </h3>
                        </a>
                        <a href="<?php the_permalink(); ?>">
                            <div class="post_thumbnail">
                                <?php the_post_thumbnail( 'post_cover' ); ?>
                            </div>
                        </a>
                        <div>
                            <span><?php echo get_the_date(); ?></span>
                            <span><?php echo the_category(', '); ?></span>
                            <span>
                            <?php
echo get_the_tag_list('<p>',', ','</p>');
?>
                            </span>
                        </div>
                    </div>
                    <?php endwhile ?>
                    <nav class="pagination">
                        <?php
echo paginate_links( array(
    'total' => $wp_query->max_num_pages,
    'prev_text'          => __(' « '),
    'next_text'          => __(' » '),
) );
    ?>
                    </nav>
                    <?php else : ?>
                    <p>Nic tu nie ma:(</p>
                    <?php endif; ?>
                </div>
            </div>
        </section>
    </main>
    <?php get_footer(); ?>

It's works for ech category, tag and custom posts taxonomies and for custom posts archive, but not for default posts archive. When I want add "all posts" to my menu, I do not have "all" option like in my CPT. What am I missing?

0

The 'All Posts' archive is a Blog. You choose a Blog page in Settings > Reading > Front page displays. It can either be the front page or another page. The template that page uses depends on what templates your theme has and the Template Hierarchy. home.php or index.php will likely be the template you use.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.