Opened 7 years ago

Closed 7 years ago

#2822 closed defect (bug) (fixed)

show_on_front kills post_type=post queries on home page

Reported by: skeltoac Owned by: skeltoac
Priority: normal Milestone: 2.1
Component: General Version: 2.1
Severity: normal Keywords:
Cc:

Description

This came up when people tried using the Recent Posts widget on their blogs when show_on_front is set to 'page'. If it's safe to assume special queries like that will provide query args, the attached patch fixes it. For example, this code is broken before and fixed after the patch:

<?php $r = new WP_Query('showposts=10'); ?>
<?php if ( $r->have_posts() ) : while ( $r->have_posts() ) : $r->the_post(); ?>
/* Loop stuff */
<?php endwhile; endif; ?>

Attachments (1)

frontpage_posts.diff (574 bytes) - added by skeltoac 7 years ago.

Download all attachments as: .zip

Change History (2)

comment:1   ryan7 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [3869]) Query fix from skeltoac. fixes #2822

Note: See TracTickets for help on using tickets.