Make WordPress Core

Opened 20 years ago

Closed 20 years ago

#2822 closed defect (bug) (fixed)

show_on_front kills post_type=post queries on home page

Reported by: skeltoac's profile skeltoac Owned by: skeltoac's profile skeltoac
Milestone: 2.1 Priority: normal
Severity: normal Version: 2.1
Component: General Keywords:
Focuses: 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 20 years ago.

Download all attachments as: .zip

Change History (2)

#1 @ryan
20 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.