[wp-trac] [WordPress Trac] #22299: posts_per_page value in $wp_query does not work in index.php
WordPress Trac
noreply at wordpress.org
Sun Oct 28 02:33:10 UTC 2012
#22299: posts_per_page value in $wp_query does not work in index.php
--------------------------+------------------------------
Reporter: alexvorn2 | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Query | Version:
Severity: normal | Resolution:
Keywords: close |
--------------------------+------------------------------
Comment (by SergeyBiryukov):
You can add `$query->is_home()` check there:
{{{
function hwl_home_pagesize( $query ) {
if ( $query->is_home() )
$query->query_vars['posts_per_page'] = 1;
return;
} add_action('pre_get_posts', 'hwl_home_pagesize', 1);
}}}
This is actually a support issue.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/22299#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list