[wp-trac] [WordPress Trac] #34766: Order by rand in taxonomy page don't work
WordPress Trac
noreply at wordpress.org
Wed Dec 30 18:00:02 UTC 2015
#34766: Order by rand in taxonomy page don't work
-------------------------------+------------------------------
Reporter: sebastian.pisula | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Query | Version:
Severity: normal | Resolution:
Keywords: reporter-feedback | Focuses:
-------------------------------+------------------------------
Changes (by swissspidy):
* keywords: => reporter-feedback
* component: General => Query
Comment:
Just to clarify, when using `new WP_Query(…)` normally, `'orderby' =>
'rand'` works perfectly, but when hooking into `pre_get_posts` it doesn't.
Correct?
Are you sure your filter is run correctly? What happens when you remove
the `if ( $query->is_main_query() && $query->is_tax( 'landing-page-
highlight', 'special-offer' ) ) {` condition?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34766#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list