Support » Plugin: IssueM » Problem with IssueM modification of WordPress query

  • Ahoi,

    I was trying to modify the author.php template and integrate a sidebar, where all of the authors woocommerce products would show up. I realized this by having a new WP_Query with post_type=product.

    The problem that occures is, that this secondary query will not only show products by the author but also articles. I narrowed the failure down to a pre_get_posts filter implemented in issuem-class.php.

    In the function add_issuem_articles_to_tag_query the if condition does not seem to be right. It correctly checks if the query is_main_query() for is_tag() and is_category(). But for is_author() that check is ommitted and thus articles get added to my secondary query, which I dont think is intended behavior (just seems like the brackets aren’t placed correctly).

    if ( ( $query->is_main_query() && ( $query->is_tag() || $query->is_category() ) ) || $query->is_author() )

    I’m using Issuem 2.6.0 on WordPress 4.7.2.

    • This topic was modified 2 years, 2 months ago by  Kossahl.
  • The topic ‘Problem with IssueM modification of WordPress query’ is closed to new replies.