• I recently set up a specific archive page to display all my posts on one page. Essentially it was set up and working fine in 2.5 as follows

    Month
    (date) Blog post

    Basically it would have all my posts organized by month on the page. Since upgrading though I’ve noticed it no longer is showing anything, the only post it shows is the most recent one I’ve written.

    Im no php expert by any means so was hoping someone could help me and explain why this would all of a sudden stop displaying all my archives, all my blog posts are still there and all other plugins Im using with them (recent posts, related posts, tag cloud etc) all seem to work.

    This is the code I have been using….

    <?php
    
    // Declare some helper vars
    $previous_year = $year = 0;
    $previous_month = $month = 0;
    $ul_open = false;
    
    // Get the posts
    $myposts = get_posts('numberposts=0&orderby=post_date&order=DESC');
    
    ?>
    
    <?php foreach($myposts as $post) : ?>	
    
    	<?php
    
    	// Setup the post variables
    	setup_postdata($post);
    
    	$year = mysql2date('Y', $post->post_date);
    	$month = mysql2date('n', $post->post_date);
    	$day = mysql2date('j', $post->post_date);
    
    	?>
    
    	<?php if($year != $previous_year || $month != $previous_month) : ?>
    
    		<?php if($ul_open == true) : ?>
    		</ul>
    		<?php endif; ?>
    
    		<h3><?php the_time('F Y'); ?></h3>
    
    		<ul class="month_archive">
    
    		<?php $ul_open = true; ?>
    
    	<?php endif; ?>
    
    	<?php $previous_year = $year; $previous_month = $month; ?>
    
    	<li><span class="the_day"><?php the_time('F d'); ?> : </span> <span class="the_article"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></span></li>
    
    <?php endforeach; ?>
  • The topic ‘Archive Page not showing all posts after 2.6 update’ is closed to new replies.