[wp-trac] [WordPress Trac] #33318: tax_query breaks certain other wp_query args

WordPress Trac noreply at wordpress.org
Thu May 26 06:26:13 UTC 2016


#33318: tax_query breaks certain other wp_query args
-------------------------------+------------------------------
 Reporter:  djripraw           |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Query              |     Version:  4.2.4
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:  template
-------------------------------+------------------------------

Comment (by m_i_n):

 Ok, after some more deep digging into code, i have that action:

 {{{
 public function actionPreGetPosts($query)
 {
         if ($query->is_tax('portfolio-category') || $query->is_tax
 ('portfolio-tag')) {
                 $query->query_vars['posts_per_page'] =
 self::to('portfolio/archive/count');
         }
 }
 }}}

 ...which refers to archive page, but it also destroy WP_Query call.

 '''Sorry for a trouble''' (very big sorry), problem solved.

 PS. Is there any way to change `posts_per_page` when `taxonomy-portfolio-
 category.php` is showed but not when custom `WP_Query` is called?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33318#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list