• Resolved katiecoleslaw

    (@katiecoleslaw)


    Hi there,

    I’m using the Twenty Twelve archive widget to display the archives for my site. I have it in the footer of the site.

    For some reason whenever I view a different month, say July 2013, it only shows me the current month (August 2013) blog entries. Why is that?

    Here is the code that I have in archive.php –

    <?php
    /*
    Template Name: Archives
    */
    ?>
    <?php get_header(); ?>
    
    <!-- the page title -->
    <header class="entry-header">
    		<h1 class="entry-title"><?php the_title(); ?></h1>
    </header>
    <section id="primary" class="site-content">
    		<div id="content" role="main">
    <div class="posts_list">
    <!-- Quary the leatest 50 posts -->
    <?php query_posts('post_type=post&posts_per_page=50'); ?>
    <?php if ( have_posts() ) : ?>
    			<?php /* Start the Loop */ ?>
    			<?php while ( have_posts() ) : the_post(); ?>
                            <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
    			<?php endwhile; ?>
    	<?php endif; ?>
    <?php wp_reset_query(); ?>
    </div><!-- .posts_list -->
    
    <!-- Show the categories -->
    <div class="categories_list">
            <?php wp_list_categories(); ?>
    </div><!-- .categories_list -->
    
    <!-- Show the Monthly archive -->
    <div class="monthly_archive">
             <?php wp_get_archives('type=monthly'); ?>
    </div><!-- .monthly_archive -->
    
    </div><!-- #content -->
    	</section><!-- #primary -->
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    Any help greatly appreciated!

    Here is the link to the site

Viewing 5 replies - 1 through 5 (of 5 total)
  • You should be using WP_Query() for a secondary loop – not query_posts().

    Thread Starter katiecoleslaw

    (@katiecoleslaw)

    Thank you, Esmi. That worked ??

    I now have loads of white space at the bottom of the archive. Do you know why that is?

    Looks like a number of different CSS factors are contributing. You have rather large border-bottom values of 5.14286rem on .site-content article. I also noticed some negative margins dotted through your CSS. The big problem with using negative top margins is that they shift content up but leave a gap (where the content originally was) behind them. You might be better off switching to using negative relative positioning and see if that helps.

    Do you use Firebug?

    Thread Starter katiecoleslaw

    (@katiecoleslaw)

    I decreased the border-bottom value. I use Firebug. Been going around changing some of the margins but to no avail..

    Thread Starter katiecoleslaw

    (@katiecoleslaw)

    I managed to get everything working. Thank you Esmi ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Twenty Twelve] Archive only showing current month’ is closed to new replies.