Title: Call Widget in php
Last modified: August 30, 2016

---

# Call Widget in php

 *  Resolved [motofusion](https://wordpress.org/support/users/motofusion/)
 * (@motofusion)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/call-widget-in-php/)
 * How can I call the yith widget in php?
 * [https://wordpress.org/plugins/yith-woocommerce-ajax-navigation/](https://wordpress.org/plugins/yith-woocommerce-ajax-navigation/)
 * I tried the method in [https://codex.wordpress.org/Function_Reference/the_widget](https://codex.wordpress.org/Function_Reference/the_widget)
   
   But it didn’t work for me

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

 *  Plugin Author [YITHEMES](https://wordpress.org/support/users/yithemes/)
 * (@yithemes)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/call-widget-in-php/#post-6415252)
 * Hi,
 * please, can you post me the code you use ?
 *  Thread Starter [motofusion](https://wordpress.org/support/users/motofusion/)
 * (@motofusion)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/call-widget-in-php/#post-6415258)
 * I used
    `<?php the_widget( 'yith-woo-ajax-navigation-3', 'dropdown', 'abc' );?
   >`
 * yith-woo-ajax-navigation-3: name got from chrome’s inspect element
    ‘abc’ is 
   attribute type that I want to filter I need dropdown filter with OR parameter
 * I also tried the following, but to same result:
    `<?php the_widget( 'yith-woo-
   ajax-navigation', 'dropdown', 'abc' ); ?>`
 *  Plugin Author [YITHEMES](https://wordpress.org/support/users/yithemes/)
 * (@yithemes)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/call-widget-in-php/#post-6415272)
 * Hi,
 * This code are wrong because the correct syntax is:
 * `<?php the_widget( $widget, $instance, $args ); ?>`
 * Where…
 * > $widget is the widget class name
 * > $instance The widget’s instance settings
 * > $args the argument for the widget class
 * this is the way it works, so in your case you can:
 *     ```
       <?php
       $instance = array(
           'title' 		= "Your Widget Title",
           'attribute' 	= 'abc',
           'query_type'	= 'or',
           'type'		= 'select'
           'display' 		= 'all'
       );
   
       the_widget( 'YITH_WCAN_Navigation_Widget', $instance );
       ?>
       ```
   
 * As you can see is a bit more complex than you thought …

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

The topic ‘Call Widget in php’ 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/)

## Tags

 * [call](https://wordpress.org/support/topic-tag/call/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [widget](https://wordpress.org/support/topic-tag/widget/)

 * 3 replies
 * 2 participants
 * Last reply from: [YITHEMES](https://wordpress.org/support/users/yithemes/)
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/call-widget-in-php/#post-6415272)
 * Status: resolved