WordPress.org

Ready to get started?Download WordPress

Forums

Archives page links to empty pages (2 posts)

  1. bobdobbs
    Member
    Posted 1 year ago #

    I've built an archives template, and assigned it to a page. Mostly, it's working: if I navigate to the page, I can see it.

    The call to wp_get_archives generates links.

    However, clicking on those links returns an empty page. I just back my single template with no content.

    What is missing from my code? How can I create an archives page that actually gives access to content?

    <?php get_header() ?>
    <div class="row">
    
    <div class="content-wrapper">
            <section id="archives">
                    <header>
                            <h1>News Archives</h1>
                    </header>
                    <p>This page lets you news posts by month.</p>
    
                    <section id="post-contents" class="archives-container">
                            <h4>Archives by Month</h4>
                            <ul id="list-archive-by-month">
                                    <?php wp_get_archives('type=monthly'); ?>
    
                    </section>
            </section> <!-- ENDS #archives -->
    </div>
    </div> <!-- row ends -->
    
    <?php  get_footer() ?>
  2. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

    try:

    <?php get_header() ?>
    <div class="row">
    <div class="content-wrapper">
            <section id="archives">
                    <header>
                            <h1>News Archives</h1>
                    </header>
                    <p>This page lets you news posts by month.</p>
    
                    <section id="post-contents" class="archives-container">
                            <h4>Archives by Month</h4>
                            <ul id="list-archive-by-month">
                                    <?php wp_get_archives( array( 'type' => 'monthly', 'limit' => 12 ) ); ?>
                    </section>
            </section> <!-- ENDS #archives -->
    </div>
    </div> <!-- row ends -->

    Of course this will get you 12 rows..

    how may need more args:
    http://codex.wordpress.org/Function_Reference/wp_get_archives

Topic Closed

This topic has been closed to new replies.

About this Topic