Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5848215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:49:40+00:00 2026-05-22T12:49:40+00:00

I am trying to have an archive section in a template with a certain

  • 0

I am trying to have an archive section in a template with a certain layout.

I am trying to get a list as follows:

FEBRUARI
01-02-2011 - Title 3
03-02-2011 - Title 4

JANUARY
01-01-2011 - Title
03-01-2011 - Title 2

< older entries     newer entries>`

I am trying to get my code to work, but it fails and only shows one post per month.

<?php
// List Pages by Month/Day
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'paged' => $paged,
 'post_type' => 'post',
 'posts_per_page' => 10,
             );
query_posts($args);
if (have_posts()) : while (have_posts()) : the_post();
  $this_dt = get_the_time('M',$post->post_date);
  if ($curr_dt != $this_dt) { ?>
<h4><?php echo $this_dt; ?></h4>
  <ul class="artikelen">
  <li><a href="<?php the_permalink(); ?>"><span><?php echo get_the_time('d');?> - <?php echo get_the_time('M');?> | <?php echo get_the_time('Y'); ?> |</span><?php the_title();?></a></li><?php echo "</ul>"; }
 $curr_dt = $this_dt; endwhile; ?>
<div class="navigation">
  <div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
  <div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
</div>
<?php else :
// Code here for no pages found
endif;
?>

I would like to know what i am doing wrong or whether its possible at all. Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T12:49:41+00:00Added an answer on May 22, 2026 at 12:49 pm

    The IF loop is only used to display The Month once, close it rightc after displaying the month:

    <?php
    // List Pages by Month/Day
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args = array(
    'paged' => $paged,
     'post_type' => 'post',
     'posts_per_page' => 10,
                 );
    query_posts($args);
    if (have_posts()) : while (have_posts()) : the_post();
      $this_dt = get_the_time('M',$post->post_date);
      if ($curr_dt != $this_dt) { ?>
    
    <h4><?php echo $this_dt; ?></h4>
    
       <?php } ?>
    
      <ul class="artikelen">
      <li><a href="<?php the_permalink(); ?>"><span><?php echo get_the_time('d');?> - <?php echo get_the_time('M');?> | <?php echo get_the_time('Y'); ?> |</span><?php the_title();?></a></li><?php echo "</ul>"; 
     $curr_dt = $this_dt; endwhile; ?>
    <div class="navigation">
      <div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
      <div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
    </div>
    <?php else :
    // Code here for no pages found
    endif;
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using VBScript (ASP Classic) and SQL Server; I'm trying to have a section
I am trying to have a logout page where is displays a messages and
I'm trying to have my Struts2 app redirect to a generated URL. In this
I'm trying to have a new layer appear above existing content on my site
I am trying to have one one layer, and center images within. I.E., if
I am trying to have a tooltip on multiple lines. how do i do
I am trying to have an element fade in, then in 5000 ms fade
I'm trying to have text spans pop up on a hover pseudo-class for different
I am trying to have a table header, in a seperate div stay in
I have been trying to implement Win32's MessageBox using GTK. The app uses SDL/OpenGL,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.