Title: Plugin not loading correct pages
Last modified: May 30, 2023

---

# Plugin not loading correct pages

 *  [matteoramdac](https://wordpress.org/support/users/matteoramdac/)
 * (@matteoramdac)
 * [3 years ago](https://wordpress.org/support/topic/plugin-not-loading-correct-pages/)
 * Hi, when I click on a category on the sidebar, the plugin doesn’t open any page
   correctly. Usually only shows a box “Shop” or “No terms found”. You can see the
   difference clicking on categories from boxes in the page
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fplugin-not-loading-correct-pages%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [crodriguez1991](https://wordpress.org/support/users/crodriguez1991/)
 * (@crodriguez1991)
 * [3 years ago](https://wordpress.org/support/topic/plugin-not-loading-correct-pages/#post-16782623)
 * Hello there,
 * I hope you’re doing well :D.
 * I checked and maybe the problem is that you are using a custom page also for 
   categories.
 * Could you make a test and disable all plugins leaving only WooCommerce and YITH
   WooCommerce Ajax Product Filter and try again?
 * Also try using a default theme like TwentySixteen.
 * I’m looking forward your response.
 * Have a good day.
 *  Thread Starter [matteoramdac](https://wordpress.org/support/users/matteoramdac/)
 * (@matteoramdac)
 * [3 years ago](https://wordpress.org/support/topic/plugin-not-loading-correct-pages/#post-16785270)
 * Yeah i’m using a custom page for categories.. is this not supported?
 *  [crodriguez1991](https://wordpress.org/support/users/crodriguez1991/)
 * (@crodriguez1991)
 * [3 years ago](https://wordpress.org/support/topic/plugin-not-loading-correct-pages/#post-16786197)
 * Hello there,
 * I hope you’re doing well :D.
 * Could you try to add the following code in the functions.php of your active theme
 *     ```wp-block-code
       if( ! function_exists( 'yith_wcan_set_query_vars' ) ){
           function yith_wcan_set_query_vars(){
               if ( ! function_exists( 'YITH_WCAN_Query' ) ) {
                   return;
               }
   
               $qo = get_queried_object();
               $query_vars = YITH_WCAN_Query()->get_query_vars();
   
   
               if ( is_product_taxonomy() && $qo instanceof WP_Term && ! isset( $query_vars[ $qo->taxonomy ] ) ) {
                   YITH_WCAN_Query()->set( $qo->taxonomy, $qo->slug );
               } elseif ( is_page() && $qo instanceof WP_Post && ! isset( $query_vars['product_cat'] ) ) {
                   $page_slug    = $qo->post_name;
                   $related_term = get_term_by( 'slug', $page_slug, 'product_cat' );
                   if ( $related_term && ! is_wp_error( $related_term ) ) {
                       YITH_WCAN_Query()->set( 'product_cat', $related_term->slug );
                   }
               }
           }
           add_action( 'wp', 'yith_wcan_set_query_vars' );
       }
       ```
   
 * It should retrieve the current category and should work for custom pages.
 * Please, try it and let me know.
 * Have a good day.
 *  Thread Starter [matteoramdac](https://wordpress.org/support/users/matteoramdac/)
 * (@matteoramdac)
 * [3 years ago](https://wordpress.org/support/topic/plugin-not-loading-correct-pages/#post-16786274)
 * Thanks, but this give me an error in WordPress:
 * **Parse error**: syntax error, unexpected token “;”, expecting “)” in **/home/
   new.masterphil.it/public_html/wp-content/themes/Avada-Child-Theme/functions.php**
   on line **84**
 *  [crodriguez1991](https://wordpress.org/support/users/crodriguez1991/)
 * (@crodriguez1991)
 * [3 years ago](https://wordpress.org/support/topic/plugin-not-loading-correct-pages/#post-16789305)
 * Hello there,
 * I hope you’re doing well 😀
 * I checked the code and seems to work fine for me. Maybe you made an error on 
   copy paste. Try to add it at the end of the functions.php file.
 * Please, try it and let me know.
 *  Thread Starter [matteoramdac](https://wordpress.org/support/users/matteoramdac/)
 * (@matteoramdac)
 * [3 years ago](https://wordpress.org/support/topic/plugin-not-loading-correct-pages/#post-16793664)
 * Hi, probably I pasted it wrong. I don’t have the error now, but it’s still not
   working like before, showing only “Shop” or “No terms found”

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Plugin not loading correct pages’ is closed to new replies.

 * ![](https://ps.w.org/yith-woocommerce-ajax-navigation/assets/icon-256x256.gif?
   rev=3129944)
 * [YITH WooCommerce Ajax Product Filter](https://wordpress.org/plugins/yith-woocommerce-ajax-navigation/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/yith-woocommerce-ajax-navigation/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/yith-woocommerce-ajax-navigation/)
 * [Active Topics](https://wordpress.org/support/plugin/yith-woocommerce-ajax-navigation/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/yith-woocommerce-ajax-navigation/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/yith-woocommerce-ajax-navigation/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [matteoramdac](https://wordpress.org/support/users/matteoramdac/)
 * Last activity: [3 years ago](https://wordpress.org/support/topic/plugin-not-loading-correct-pages/#post-16793664)
 * Status: not resolved