Articles on site not displaying in proper / default order
-
Hi,
I am new to WordPress.
Does anyone know what might cause posts not to display in the default reverse-chronological order?
For example, on the dashboard, the articles are displayed in proper order:
Article A
Published: July 1Article B
Published: June 1Article C
Published: May 1But on the site, they display as follows:
Article B
Published: June 1Article C
Published: May 1Article A
Published: July 1I am using the following code for the loop:
<div id="articles-container"> <?php $article_args = array( 'category__and' => array( 65, 3 ),'posts_per_page' => 50, 'post_type' => 'post'); $article_query = new WP_Query( $article_args ); if (have_posts()): while ( $article_query->have_posts() ) : $article_query->the_post(); $permalink = get_permalink(); ?> <article class="single-article"> <h3><a href="<?php echo $permalink; ?>"><?php the_title(); ?></a></h3> <div id="article-date"><?php the_date('M j, Y', '<p>', '</p>'); ?></div> <?php the_excerpt(); ?> </article> <?php endwhile; else: ?> <h4>There are currently no articles that fall under this category.</h4> <?php endif; wp_reset_postdata(); ?> </div>
I have tried deactivating some plugins that I thought might be causing a problem. Didn’t make a difference.
Thank you for any help you can provide.
- The topic ‘Articles on site not displaying in proper / default order’ is closed to new replies.